* add some functions for terminal localizations

* fix few issues with the pre-ci tests



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6253 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Navid Nikaein
2014-12-11 17:39:37 +00:00
parent 80eca142cb
commit ee3d40640c
33 changed files with 1067 additions and 425 deletions
+1
View File
@@ -362,6 +362,7 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS
void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*);
void (*fn_rrc) (void);
uint8_t (*get_rrc_status)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t eNB_index);
double (*rrc_get_estimated_ue_distance) (module_id_t Mod_id, uint8_t UE_id, uint8_t CC_id, uint8_t loc_type);
}RRC_XFACE;
+33
View File
@@ -468,3 +468,36 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
return(0);
}
#ifdef LOCALIZATION
double
rrc_get_estimated_ue_distance(module_id_t Mod_id, const frame_t frameP, uint8_t UE_id, int CC_id, uint8_t loc_type){
// localization types:
// 0: power based
// 1: time based
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
int pCCid;
uint16_t rnti;
//for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) {
pCCid = UE_PCCID(Mod_id,UE_id);
rnti = UE_list->UE_template[pCCid][UE_id].rnti;
if(rnti == 0)
return -1;
eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,pCCid,rnti);
switch (loc_type) {
case 0:
return eNB_UE_stats->distance.power_based;
break;
case 1:
return eNB_UE_stats->distance.time_based;
break;
default:
return eNB_UE_stats->distance.power_based;
}
// LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[Mod_id].UE_list.UE_template[CC_id][UE_id].distance.power_based);
}
#endif
+7 -85
View File
@@ -567,6 +567,12 @@ typedef struct{
uint32_t ul_buffer_info[MAX_NUM_LCGID];
/// UE tx power
int32_t ue_tx_power;
#ifdef LOCALIZATION
eNB_UE_estimated_distances distance;
#endif
} UE_TEMPLATE;
typedef struct{
@@ -919,91 +925,7 @@ typedef struct {
uint8_t n_adj_cells;
} neigh_cell_id_t;
/* \brief Generate header for DL-SCH. This function parses the desired control elements and sdus and generates the header as described
in 36-321 MAC layer specifications. It returns the number of bytes used for the header to be used as an offset for the payload
in the DLSCH buffer.
@param mac_header Pointer to the first byte of the MAC header (DL-SCH buffer)
@param num_sdus Number of SDUs in the payload
@param sdu_lengths Pointer to array of SDU lengths
@param sdu_lcids Pointer to array of LCIDs (the order must be the same as the SDU length array)
@param drx_cmd dicontinous reception command
@param timing_advancd_cmd timing advanced command
@param ue_cont_res_id Pointer to contention resolution identifier (NULL means not present in payload)
@param short_padding Number of bytes for short padding (0,1,2)
@param post_padding number of bytes for padding at the end of MAC PDU
@returns Number of bytes used for header
*/
unsigned char generate_dlsch_header(unsigned char *mac_header,
unsigned char num_sdus,
unsigned short *sdu_lengths,
unsigned char *sdu_lcids,
unsigned char drx_cmd,
short timing_advance_cmd,
unsigned char *ue_cont_res_id,
unsigned char short_padding,
unsigned short post_padding);
/** \brief RRC Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
@param Mod_id Instance ID of eNB
@param eNB_flag Indicates if this is a eNB or UE configuration
@param UE_id Index of UE if this is an eNB configuration
@param eNB_id Index of eNB if this is a UE configuration
@param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration)
@param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration)
@param measObj Structure from RRCConnectionReconfiguration for UE measurement procedures
@param mac_MainConfig Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated MAC parameters (if NULL keep existing configuration)
@param logicalChannelIdentity Logical channel identity index of corresponding logical channel config
@param logicalChannelConfig Pointer to logical channel configuration
@param measGapConfig Measurement Gap configuration for MAC (if NULL keep existing configuration)
@param tdd_Config TDD Configuration from SIB1 (if NULL keep existing configuration)
@param mobilityControlInfo mobility control info received for Handover
@param SIwindowsize SI Windowsize from SIB1 (if NULL keep existing configuration)
@param SIperiod SI Period from SIB1 (if NULL keep existing configuration)
@param MBMS_Flag indicates MBMS transmission
@param mbsfn_SubframeConfigList pointer to mbsfn subframe configuration list from SIB2
@param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
@param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
*/
int rrc_mac_config_req(module_id_t module_idP,
eNB_flag_t eNB_flag,
uint8_t UE_id,
uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
#ifdef Rel10
SCellToAddMod_r10_t *sCellToAddMod_r10,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
MeasObjectToAddMod_t **measObj,
MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
MobilityControlInfo_t *mobilityControlInfo,
uint8_t *SIwindowsize,
uint16_t *SIperiod,
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
#ifdef Rel10
,
uint8_t MBMS_Flag,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
PMCH_InfoList_r9_t *pmch_InfoList
#endif
#ifdef CBA
,
uint8_t num_active_cba_groups,
uint16_t cba_rnti
#endif
);
#include "proto.h"
/*@}*/
#endif /*__LAYER2_MAC_DEFS_H__ */
+2 -1
View File
@@ -188,7 +188,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
rrc_rx_tx(module_idP,
frameP,
1,
module_idP);
module_idP,
CC_id);
#ifdef Rel10
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
+20 -3
View File
@@ -392,7 +392,7 @@ void schedule_ue_spec(module_id_t module_idP,
uint8_t dl_pow_off[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
unsigned char rballoc_sub_UE[MAX_NUM_CCs][NUMBER_OF_UE_MAX][N_RBG_MAX];
uint16_t pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int mcs,mcs2;
int mcs;
uint16_t min_rb_unit[MAX_NUM_CCs];
short ta_update = 0;
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
@@ -708,7 +708,24 @@ void schedule_ue_spec(module_id_t module_idP,
// check first for RLC data on DCCH
// add the length for all the control elements (timing adv, drx, etc) : header + payload
#ifndef EXMIMO_IOT
ta_len = ((eNB_UE_stats->timing_advance_update/4)!=0) ? 2 : 0;
// to be checked by RK, NN, FK
uint8_t update_TA;
switch (frame_parms[CC_id]->N_RB_DL)
{
case 6:
update_TA = 1;
break;
case 25:
update_TA = 4;
break;
case 50:
update_TA = 8;
break;
case 100:
update_TA = 16;
break;
}
ta_len = ((eNB_UE_stats->timing_advance_update/update_TA)!=0) ? 2 : 0;
#else
ta_len = 0;
#endif
@@ -936,7 +953,7 @@ void schedule_ue_spec(module_id_t module_idP,
post_padding = TBS - sdu_length_total - header_len_dcch - header_len_dtch - ta_len ; // 1 is for the postpadding header
}
#ifndef EXMIMO_IOT
ta_update = eNB_UE_stats->timing_advance_update/4;
ta_update = eNB_UE_stats->timing_advance_update/update_TA;
#else
ta_update = 0;
#endif
+3
View File
@@ -961,6 +961,9 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
tbs = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]);
tx_power = mac_xface->estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0);
}
UE_template->ue_tx_power = tx_power;
if (rb_table[rb_table_index]>(frame_parms->N_RB_UL-first_rb[CC_id]-1)) {
rb_table_index--;
}
+97 -1
View File
@@ -498,7 +498,7 @@ void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_templat
\param[in] eNB_index instance of eNB
@returns L2 state (CONNETION_OK or CONNECTION_LOST or PHY_RESYNCH)
*/
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index);
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index,int CC_id);
/*! \fn int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index);
\brief determine whether to use cba resource to transmit or not
@@ -656,5 +656,101 @@ void update_ul_dci(module_id_t module_idP,uint8_t CC_id,rnti_t rnti,uint8_t dai)
int get_min_rb_unit(module_id_t module_idP, uint8_t CC_id);
/* \brief Generate header for DL-SCH. This function parses the desired control elements and sdus and generates the header as described
in 36-321 MAC layer specifications. It returns the number of bytes used for the header to be used as an offset for the payload
in the DLSCH buffer.
@param mac_header Pointer to the first byte of the MAC header (DL-SCH buffer)
@param num_sdus Number of SDUs in the payload
@param sdu_lengths Pointer to array of SDU lengths
@param sdu_lcids Pointer to array of LCIDs (the order must be the same as the SDU length array)
@param drx_cmd dicontinous reception command
@param timing_advancd_cmd timing advanced command
@param ue_cont_res_id Pointer to contention resolution identifier (NULL means not present in payload)
@param short_padding Number of bytes for short padding (0,1,2)
@param post_padding number of bytes for padding at the end of MAC PDU
@returns Number of bytes used for header
*/
unsigned char generate_dlsch_header(unsigned char *mac_header,
unsigned char num_sdus,
unsigned short *sdu_lengths,
unsigned char *sdu_lcids,
unsigned char drx_cmd,
short timing_advance_cmd,
unsigned char *ue_cont_res_id,
unsigned char short_padding,
unsigned short post_padding);
/** \brief RRC Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
@param Mod_id Instance ID of eNB
@param eNB_flag Indicates if this is a eNB or UE configuration
@param UE_id Index of UE if this is an eNB configuration
@param eNB_id Index of eNB if this is a UE configuration
@param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration)
@param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration)
@param measObj Structure from RRCConnectionReconfiguration for UE measurement procedures
@param mac_MainConfig Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated MAC parameters (if NULL keep existing configuration)
@param logicalChannelIdentity Logical channel identity index of corresponding logical channel config
@param logicalChannelConfig Pointer to logical channel configuration
@param measGapConfig Measurement Gap configuration for MAC (if NULL keep existing configuration)
@param tdd_Config TDD Configuration from SIB1 (if NULL keep existing configuration)
@param mobilityControlInfo mobility control info received for Handover
@param SIwindowsize SI Windowsize from SIB1 (if NULL keep existing configuration)
@param SIperiod SI Period from SIB1 (if NULL keep existing configuration)
@param MBMS_Flag indicates MBMS transmission
@param mbsfn_SubframeConfigList pointer to mbsfn subframe configuration list from SIB2
@param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
@param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
*/
int rrc_mac_config_req(module_id_t module_idP,
eNB_flag_t eNB_flag,
uint8_t UE_id,
uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
#ifdef Rel10
SCellToAddMod_r10_t *sCellToAddMod_r10,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
MeasObjectToAddMod_t **measObj,
MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
MobilityControlInfo_t *mobilityControlInfo,
uint8_t *SIwindowsize,
uint16_t *SIperiod,
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
#ifdef Rel10
,
uint8_t MBMS_Flag,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
PMCH_InfoList_r9_t *pmch_InfoList
#endif
#ifdef CBA
,
uint8_t num_active_cba_groups,
uint16_t cba_rnti
#endif
);
/** \brief get the estimated UE distance from the PHY->MAC layer.
@param Mod_id Instance ID of eNB
@param UE_id Index of UE if this is an eNB configuration
@param CC_id Component Carrier Index
@param loc_type localization type: time-based or power-based
@return the estimated distance in meters
*/
double
rrc_get_estimated_ue_distance(module_id_t Mod_id,
const frame_t frameP,
uint8_t UE_id,
int CC_id,
uint8_t loc_type);
#endif
+3 -2
View File
@@ -1311,7 +1311,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
// 3. Perform SR/BSR procedures for scheduling feedback
// 4. Perform PHR procedures
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP, lte_subframe_t directionP,uint8_t eNB_indexP) {
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP, lte_subframe_t directionP,uint8_t eNB_indexP,int CC_id) {
int lcid; // lcid index
int TTI= 1;
@@ -1377,7 +1377,8 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
switch (rrc_rx_tx(module_idP,
frameP,
0,
eNB_indexP)) {
eNB_indexP,
CC_id)) {
case RRC_OK:
break;
case RRC_ConnSetup_failed:
+11 -231
View File
@@ -366,6 +366,16 @@ typedef struct eNB_RRC_INST_s {
/* Used integrity/ciphering algorithms */
e_SecurityAlgorithmConfig__cipheringAlgorithm ciphering_algorithm[NUMBER_OF_UE_MAX];
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm[NUMBER_OF_UE_MAX];
#ifdef LOCALIZATION
/// localization type, 0: power based, 1: time based
uint8_t loc_type;
/// epoch timestamp in millisecond, RRC
int32_t reference_timestamp_ms;
/// aggregate physical states every n millisecond
int32_t aggregation_period_ms;
/// localization list for aggregated measurements from PHY
struct list loc_list;
#endif
} eNB_RRC_INST;
#define MAX_UE_CAPABILITY_SIZE 255
@@ -458,237 +468,7 @@ typedef struct UE_RRC_INST_s {
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
} UE_RRC_INST;
//main.c
int rrc_init_global_param(void);
int L3_xface_init(void);
void openair_rrc_top_init(int eMBMS_active, uint8_t cba_group_active,uint8_t HO_enabled);
char openair_rrc_lite_eNB_init(module_id_t module_idP);
char openair_rrc_lite_ue_init(module_id_t module_idP,uint8_t CH_IDX);
void rrc_config_buffer(SRB_INFO *srb_info, uint8_t Lchan_type, uint8_t Role);
void openair_rrc_on(module_id_t module_idP, eNB_flag_t eNB_flagP);
void rrc_top_cleanup(void);
#include "proto.h"
/** \brief Function to update timers every subframe. For UE it updates T300,T304 and T310.
@param module_idP Instance of UE/eNB
@param frame Frame index
@param eNB_flag Flag to indicate if this instance is and eNB or UE
@param index Index of corresponding eNB (for UE)
*/
RRC_status_t rrc_rx_tx(module_id_t module_idP,frame_t frameP, eNB_flag_t eNB_flagP,uint8_t index);
// UE RRC Procedures
/** \brief Decodes DL-CCCH message and invokes appropriate routine to handle the message
\param module_idP Instance ID of UE
\param Srb_info Pointer to SRB_INFO structure (SRB0)
\param eNB_index Index of corresponding eNB/CH*/
int rrc_ue_decode_ccch(module_id_t module_idP, frame_t frameP, SRB_INFO *Srb_info,uint8_t eNB_index);
/** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message
\param module_idP Instance ID of UE
\param frame Frame index
\param Srb_id Index of Srb (1,2)
\param buffer_pP Pointer to received SDU
\param eNB_index Index of corresponding CH/eNB*/
void rrc_ue_decode_dcch(module_id_t module_idP, frame_t frameP, uint8_t Srb_id, uint8_t* buffer_pP,uint8_t eNB_index);
/** \brief Generate/Encodes RRCConnnectionRequest message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param Srb_id Index of Srb (1,2)
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_generate_RRCConnectionRequest(module_id_t module_idP, frame_t frameP, uint8_t eNB_index);
/** \brief Generates/Encodes RRCConnnectionSetupComplete message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_generate_RRCConnectionSetupComplete(module_id_t module_idP,frame_t frameP,uint8_t eNB_index, uint8_t Transaction_id);
/** \brief process the received rrcConnectionReconfiguration message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param *rrcConnectionReconfiguration pointer to the sturcture
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_process_rrcConnectionReconfiguration(module_id_t module_idP, frame_t frameP,RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,uint8_t eNB_index);
/** \brief Generates/Encodes RRCConnectionReconfigurationComplete message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_generate_RRCConnectionReconfigurationComplete(module_id_t module_idP, frame_t frameP, uint8_t eNB_index, uint8_t Transaction_id);
/** \brief Establish SRB1 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH
\param SRB_config Pointer to SRB_ToAddMod IE from configuration
@returns 0 on success*/
int32_t rrc_ue_establish_srb1(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,struct SRB_ToAddMod *SRB_config);
/** \brief Establish SRB2 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH
\param SRB_config Pointer to SRB_ToAddMod IE from configuration
@returns 0 on success*/
int32_t rrc_ue_establish_srb2(module_id_t module_idP,frame_t frameP, uint8_t eNB_index,struct SRB_ToAddMod *SRB_config);
/** \brief Establish a DRB according to DRB_ToAddMod structure
\param module_idP Instance ID of UE
\param eNB_index Index of corresponding CH/eNB
\param DRB_config Pointer to DRB_ToAddMod IE from configuration
@returns 0 on success */
int32_t rrc_ue_establish_drb(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,struct DRB_ToAddMod *DRB_config);
/** \brief Process MobilityControlInfo Message to proceed with handover and configure PHY/MAC
\param module_idP Instance of UE on which to act
\param frame frame time interval
\param eNB_index Index of corresponding CH/eNB
\param mobilityControlInfo Pointer to mobilityControlInfo
*/
void rrc_ue_process_mobilityControlInfo(module_id_t enb_module_idP, module_id_t ue_module_idP, frame_t frameP, struct MobilityControlInfo *mobilityControlInfo);
/** \brief Process a measConfig Message and configure PHY/MAC
\param module_idP Instance of UE on which to act
\param frame frame time interval
\param eNB_index Index of corresponding CH/eNB
\param measConfig Pointer to MeasConfig IE from configuration*/
void rrc_ue_process_measConfig(module_id_t module_idP,frame_t frameP, uint8_t eNB_index,MeasConfig_t *measConfig);
/** \brief Process a RadioResourceConfigDedicated Message and configure PHY/MAC
\param module_idP Instance of UE on which to act
\param eNB_index Index of corresponding CH/eNB
\param radioResourceConfigDedicated Pointer to RadioResourceConfigDedicated IE from configuration*/
void rrc_ue_process_radioResourceConfigDedicated(module_id_t module_idP,frame_t frameP, uint8_t eNB_index,
RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
// eNB/CH RRC Procedures
/**\brief Function to get the next transaction identifier.
\param module_idP Instance ID for CH/eNB
\return a transaction identifier*/
uint8_t rrc_eNB_get_next_transaction_identifier(module_id_t module_idP);
/**\brief Entry routine to decode a UL-CCCH-Message. Invokes PER decoder and parses message.
\param module_idP Instance ID for CH/eNB
\param frame Frame index
\param Srb_info Pointer to SRB0 information structure (buffer, etc.)*/
int rrc_eNB_decode_ccch(module_id_t module_idP, frame_t frameP, SRB_INFO *Srb_info);
/**\brief Entry routine to decode a UL-DCCH-Message. Invokes PER decoder and parses message.
\param module_idP Instance ID for CH/eNB
\param frame Frame index
\param ue_module_idP Index of UE sending the message
\param Rx_sdu Pointer Received Message
\param sdu_size Size of incoming SDU*/
int rrc_eNB_decode_dcch(module_id_t module_idP, frame_t frameP, uint8_t Srb_id, module_id_t ue_module_idP, uint8_t *Rx_sdu, sdu_size_t sdu_size);
/**\brief Generate the RRCConnectionSetup based on information coming from RRM
\param module_idP Instance ID for eNB/CH
\param frame Frame index
\param ue_module_idP Index of UE receiving the message*/
void rrc_eNB_generate_RRCConnectionSetup(module_id_t module_idP,frame_t frameP, module_id_t ue_module_idP);
/**\brief Process the RRCConnectionSetupComplete based on information coming from UE
\param module_idP Instance ID for eNB/CH
\param frame Frame index
\param ue_module_idP Index of UE transmitting the message
\param rrcConnectionSetupComplete Pointer to RRCConnectionSetupComplete message*/
void rrc_eNB_process_RRCConnectionSetupComplete(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP,
RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete);
/**\brief Process the RRCConnectionReconfigurationComplete based on information coming from UE
\param module_idP Instance ID for eNB/CH
\param ue_module_idP Index of UE transmitting the messages
\param rrcConnectionReconfigurationComplete Pointer to RRCConnectionReconfigurationComplete message*/
void rrc_eNB_process_RRCConnectionReconfigurationComplete(module_id_t module_idP,frame_t frameP,module_id_t ue_module_idP,RRCConnectionReconfigurationComplete_r8_IEs_t *rrcConnectionReconfigurationComplete);
/**\brief Generate the RRCConnectionRelease
\param module_idP Instance ID for eNB
\param frame Frame index
\param ue_module_idP Index of UE receiving the message*/
void rrc_eNB_generate_RRCConnectionRelease(module_id_t module_idP,frame_t frameP, ue_id_t ue_idP);
#if defined(ENABLE_ITTI)
/**\brief RRC eNB task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_enb_task(void *args_p);
/**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_ue_task(void *args_p);
#endif
/**\brief Generate/decode the handover RRCConnectionReconfiguration at eNB
\param module_idP Instance ID for eNB/CH
\param frame Frame index
\param ue_module_idP Index of UE transmitting the messages*/
void rrc_eNB_generate_RRCConnectionReconfiguration_handover(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP, uint8_t *nas_pdu, uint32_t nas_length);
//L2_interface.c
int8_t mac_rrc_lite_data_req( module_id_t module_idP, frame_t frameP, rb_id_t Srb_id, uint8_t Nb_tb, uint8_t *buffer_pP,eNB_flag_t eNB_flagP, uint8_t eNB_index, uint8_t mbsfn_sync_area);
int8_t mac_rrc_lite_data_ind( module_id_t module_idP, frame_t frameP, rb_id_t Srb_id, uint8_t *Sdu, sdu_size_t Sdu_len,eNB_flag_t eNB_flagP,uint8_t eNB_index, uint8_t mbsfn_sync_area);
void mac_sync_ind( module_id_t Mod_instP, uint8_t status);
uint8_t rrc_lite_data_req(module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
frame_t frameP,
eNB_flag_t eNB_flagP,
rb_id_t rb_idP,
mui_t muiP,
confirm_t confirmP,
sdu_size_t sdu_sizeP,
uint8_t *Buffer_pP,
pdcp_transmission_mode_t modeP);
void rrc_lite_data_ind(module_id_t eNB_id, module_id_t UE_id, frame_t frameP, eNB_flag_t eNB_flagP, rb_id_t Rb_id, sdu_size_t sdu_size,uint8_t *buffer_pP);
void rrc_lite_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index);
void rrc_lite_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index);
int decode_MCCH_Message(module_id_t module_idP, frame_t frameP, uint8_t eNB_index, uint8_t *Sdu, uint8_t Sdu_len,uint8_t mbsfn_sync_area);
void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area);
int decode_BCCH_DLSCH_Message(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,uint8_t *Sdu,uint8_t Sdu_len, uint8_t rsrq, uint8_t rsrp);
int decode_SIB1(module_id_t module_idP,uint8_t eNB_index, uint8_t rsrq, uint8_t rsrp);
int decode_SI(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,uint8_t si_window);
void ue_meas_filtering(module_id_t module_idP,frame_t frameP,uint8_t eNB_index);
void ue_measurement_report_triggering(module_id_t module_idP, frame_t frameP,uint8_t eNB_index);
int mac_get_rrc_lite_status(module_id_t module_idP,eNB_flag_t eNB_flagP,uint8_t index);
void rrc_eNB_generate_UECapabilityEnquiry(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP);
void rrc_eNB_generate_SecurityModeCommand(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP);
void rrc_eNB_process_MeasurementReport(uint8_t module_idP,frame_t frameP, module_id_t ue_module_idP,MeasResults_t *measResults2) ;
void rrc_ue_generate_MeasurementReport(module_id_t eNB_id, module_id_t UE_id, frame_t frameP);
void rrc_eNB_generate_HandoverPreparationInformation (uint8_t module_idP, frame_t frameP, module_id_t ue_module_idP, PhysCellId_t targetPhyId) ;
void check_handovers(uint8_t module_idP, frame_t frameP);
uint8_t check_trigger_meas_event(uint8_t module_idP,frame_t frameP, uint8_t eNB_index, uint8_t ue_cnx_index, uint8_t meas_index,
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
//void rrc_ue_process_ueCapabilityEnquiry(uint8_t module_idP,uint32_t frame,UECapabilityEnquiry_t *UECapabilityEnquiry,uint8_t eNB_index);
//void rrc_ue_process_securityModeCommand(uint8_t module_idP,uint32_t frame,SecurityModeCommand_t *securityModeCommand,uint8_t eNB_index);
void rrc_eNB_free_UE_index (module_id_t enb_mod_idP, module_id_t ue_mod_idP);
long binary_search_int(int elements[], long numElem, int value);
long binary_search_float(float elements[], long numElem, float value);
#endif
/** @ */
+271
View File
@@ -0,0 +1,271 @@
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file proto.h
* \brief RRC functions prototypes for eNB and UE
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \email navid.nikaein@eurecom.fr
* \version 1.0
* @ingroup _rrc
*/
//main.c
int rrc_init_global_param(void);
int L3_xface_init(void);
void openair_rrc_top_init(int eMBMS_active, uint8_t cba_group_active,uint8_t HO_enabled);
char openair_rrc_lite_eNB_init(module_id_t module_idP);
char openair_rrc_lite_ue_init(module_id_t module_idP,uint8_t CH_IDX);
void rrc_config_buffer(SRB_INFO *srb_info, uint8_t Lchan_type, uint8_t Role);
void openair_rrc_on(module_id_t module_idP, eNB_flag_t eNB_flagP);
void rrc_top_cleanup(void);
/** \brief Function to update timers every subframe. For UE it updates T300,T304 and T310.
@param module_idP Instance of UE/eNB
@param frame Frame index
@param eNB_flag Flag to indicate if this instance is and eNB or UE
@param index Index of corresponding eNB (for UE)
*/
RRC_status_t rrc_rx_tx(module_id_t module_idP,frame_t frameP, eNB_flag_t eNB_flagP,uint8_t index,int CC_id);
// UE RRC Procedures
/** \brief Decodes DL-CCCH message and invokes appropriate routine to handle the message
\param module_idP Instance ID of UE
\param Srb_info Pointer to SRB_INFO structure (SRB0)
\param eNB_index Index of corresponding eNB/CH*/
int rrc_ue_decode_ccch(module_id_t module_idP, frame_t frameP, SRB_INFO *Srb_info,uint8_t eNB_index);
/** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message
\param module_idP Instance ID of UE
\param frame Frame index
\param Srb_id Index of Srb (1,2)
\param buffer_pP Pointer to received SDU
\param eNB_index Index of corresponding CH/eNB*/
void rrc_ue_decode_dcch(module_id_t module_idP, frame_t frameP, uint8_t Srb_id, uint8_t* buffer_pP,uint8_t eNB_index);
/** \brief Generate/Encodes RRCConnnectionRequest message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param Srb_id Index of Srb (1,2)
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_generate_RRCConnectionRequest(module_id_t module_idP, frame_t frameP, uint8_t eNB_index);
/** \brief Generates/Encodes RRCConnnectionSetupComplete message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_generate_RRCConnectionSetupComplete(module_id_t module_idP,frame_t frameP,uint8_t eNB_index, uint8_t Transaction_id);
/** \brief process the received rrcConnectionReconfiguration message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param *rrcConnectionReconfiguration pointer to the sturcture
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_process_rrcConnectionReconfiguration(module_id_t module_idP, frame_t frameP,RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,uint8_t eNB_index);
/** \brief Generates/Encodes RRCConnectionReconfigurationComplete message at UE
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH*/
void rrc_ue_generate_RRCConnectionReconfigurationComplete(module_id_t module_idP, frame_t frameP, uint8_t eNB_index, uint8_t Transaction_id);
/** \brief Establish SRB1 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH
\param SRB_config Pointer to SRB_ToAddMod IE from configuration
@returns 0 on success*/
int32_t rrc_ue_establish_srb1(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,struct SRB_ToAddMod *SRB_config);
/** \brief Establish SRB2 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly
\param module_idP Instance ID of UE
\param frame Frame index
\param eNB_index Index of corresponding eNB/CH
\param SRB_config Pointer to SRB_ToAddMod IE from configuration
@returns 0 on success*/
int32_t rrc_ue_establish_srb2(module_id_t module_idP,frame_t frameP, uint8_t eNB_index,struct SRB_ToAddMod *SRB_config);
/** \brief Establish a DRB according to DRB_ToAddMod structure
\param module_idP Instance ID of UE
\param eNB_index Index of corresponding CH/eNB
\param DRB_config Pointer to DRB_ToAddMod IE from configuration
@returns 0 on success */
int32_t rrc_ue_establish_drb(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,struct DRB_ToAddMod *DRB_config);
/** \brief Process MobilityControlInfo Message to proceed with handover and configure PHY/MAC
\param module_idP Instance of UE on which to act
\param frame frame time interval
\param eNB_index Index of corresponding CH/eNB
\param mobilityControlInfo Pointer to mobilityControlInfo
*/
void rrc_ue_process_mobilityControlInfo(module_id_t enb_module_idP, module_id_t ue_module_idP, frame_t frameP, struct MobilityControlInfo *mobilityControlInfo);
/** \brief Process a measConfig Message and configure PHY/MAC
\param module_idP Instance of UE on which to act
\param frame frame time interval
\param eNB_index Index of corresponding CH/eNB
\param measConfig Pointer to MeasConfig IE from configuration*/
void rrc_ue_process_measConfig(module_id_t module_idP,frame_t frameP, uint8_t eNB_index,MeasConfig_t *measConfig);
/** \brief Process a RadioResourceConfigDedicated Message and configure PHY/MAC
\param module_idP Instance of UE on which to act
\param eNB_index Index of corresponding CH/eNB
\param radioResourceConfigDedicated Pointer to RadioResourceConfigDedicated IE from configuration*/
void rrc_ue_process_radioResourceConfigDedicated(module_id_t module_idP,frame_t frameP, uint8_t eNB_index,
RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
// eNB/CH RRC Procedures
/**\brief Function to get the next transaction identifier.
\param module_idP Instance ID for CH/eNB
\return a transaction identifier*/
uint8_t rrc_eNB_get_next_transaction_identifier(module_id_t module_idP);
/**\brief Entry routine to decode a UL-CCCH-Message. Invokes PER decoder and parses message.
\param module_idP Instance ID for CH/eNB
\param frame Frame index
\param Srb_info Pointer to SRB0 information structure (buffer, etc.)*/
int rrc_eNB_decode_ccch(module_id_t module_idP, frame_t frameP, SRB_INFO *Srb_info);
/**\brief Entry routine to decode a UL-DCCH-Message. Invokes PER decoder and parses message.
\param module_idP Instance ID for CH/eNB
\param frame Frame index
\param ue_module_idP Index of UE sending the message
\param Rx_sdu Pointer Received Message
\param sdu_size Size of incoming SDU*/
int rrc_eNB_decode_dcch(module_id_t module_idP, frame_t frameP, uint8_t Srb_id, module_id_t ue_module_idP, uint8_t *Rx_sdu, sdu_size_t sdu_size);
/**\brief Generate the RRCConnectionSetup based on information coming from RRM
\param module_idP Instance ID for eNB/CH
\param frame Frame index
\param ue_module_idP Index of UE receiving the message*/
void rrc_eNB_generate_RRCConnectionSetup(module_id_t module_idP,frame_t frameP, module_id_t ue_module_idP);
/**\brief Process the RRCConnectionSetupComplete based on information coming from UE
\param module_idP Instance ID for eNB/CH
\param frame Frame index
\param ue_module_idP Index of UE transmitting the message
\param rrcConnectionSetupComplete Pointer to RRCConnectionSetupComplete message*/
void rrc_eNB_process_RRCConnectionSetupComplete(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP,
RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete);
/**\brief Process the RRCConnectionReconfigurationComplete based on information coming from UE
\param module_idP Instance ID for eNB/CH
\param ue_module_idP Index of UE transmitting the messages
\param rrcConnectionReconfigurationComplete Pointer to RRCConnectionReconfigurationComplete message*/
void rrc_eNB_process_RRCConnectionReconfigurationComplete(module_id_t module_idP,frame_t frameP,module_id_t ue_module_idP,RRCConnectionReconfigurationComplete_r8_IEs_t *rrcConnectionReconfigurationComplete);
/**\brief Generate the RRCConnectionRelease
\param module_idP Instance ID for eNB
\param frame Frame index
\param ue_module_idP Index of UE receiving the message*/
void rrc_eNB_generate_RRCConnectionRelease(module_id_t module_idP,frame_t frameP, ue_id_t ue_idP);
#if defined(ENABLE_ITTI)
/**\brief RRC eNB task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_enb_task(void *args_p);
/**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_ue_task(void *args_p);
#endif
/**\brief Generate/decode the handover RRCConnectionReconfiguration at eNB
\param module_idP Instance ID for eNB/CH
\param frame Frame index
\param ue_module_idP Index of UE transmitting the messages*/
void rrc_eNB_generate_RRCConnectionReconfiguration_handover(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP, uint8_t *nas_pdu, uint32_t nas_length);
//L2_interface.c
int8_t mac_rrc_lite_data_req( module_id_t module_idP, frame_t frameP, rb_id_t Srb_id, uint8_t Nb_tb, uint8_t *buffer_pP,eNB_flag_t eNB_flagP, uint8_t eNB_index, uint8_t mbsfn_sync_area);
int8_t mac_rrc_lite_data_ind( module_id_t module_idP, frame_t frameP, rb_id_t Srb_id, uint8_t *Sdu, sdu_size_t Sdu_len,eNB_flag_t eNB_flagP,uint8_t eNB_index, uint8_t mbsfn_sync_area);
void mac_sync_ind( module_id_t Mod_instP, uint8_t status);
uint8_t rrc_lite_data_req(module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
frame_t frameP,
eNB_flag_t eNB_flagP,
rb_id_t rb_idP,
mui_t muiP,
confirm_t confirmP,
sdu_size_t sdu_sizeP,
uint8_t *Buffer_pP,
pdcp_transmission_mode_t modeP);
void rrc_lite_data_ind(module_id_t eNB_id, module_id_t UE_id, frame_t frameP, eNB_flag_t eNB_flagP, rb_id_t Rb_id, sdu_size_t sdu_size,uint8_t *buffer_pP);
void rrc_lite_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index);
void rrc_lite_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index);
int decode_MCCH_Message(module_id_t module_idP, frame_t frameP, uint8_t eNB_index, uint8_t *Sdu, uint8_t Sdu_len,uint8_t mbsfn_sync_area);
void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area);
int decode_BCCH_DLSCH_Message(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,uint8_t *Sdu,uint8_t Sdu_len, uint8_t rsrq, uint8_t rsrp);
int decode_SIB1(module_id_t module_idP,uint8_t eNB_index, uint8_t rsrq, uint8_t rsrp);
int decode_SI(module_id_t module_idP,frame_t frameP,uint8_t eNB_index,uint8_t si_window);
void ue_meas_filtering(module_id_t module_idP,frame_t frameP,uint8_t eNB_index);
void ue_measurement_report_triggering(module_id_t module_idP, frame_t frameP,uint8_t eNB_index);
int mac_get_rrc_lite_status(module_id_t module_idP,eNB_flag_t eNB_flagP,uint8_t index);
void rrc_eNB_generate_UECapabilityEnquiry(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP);
void rrc_eNB_generate_SecurityModeCommand(module_id_t module_idP, frame_t frameP, module_id_t ue_module_idP);
void rrc_eNB_process_MeasurementReport(uint8_t module_idP,frame_t frameP, module_id_t ue_module_idP,MeasResults_t *measResults2) ;
void rrc_ue_generate_MeasurementReport(module_id_t eNB_id, module_id_t UE_id, frame_t frameP);
void rrc_eNB_generate_HandoverPreparationInformation (uint8_t module_idP, frame_t frameP, module_id_t ue_module_idP, PhysCellId_t targetPhyId) ;
void check_handovers(uint8_t module_idP, frame_t frameP);
uint8_t check_trigger_meas_event(uint8_t module_idP,frame_t frameP, uint8_t eNB_index, uint8_t ue_cnx_index, uint8_t meas_index,
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
//void rrc_ue_process_ueCapabilityEnquiry(uint8_t module_idP,uint32_t frame,UECapabilityEnquiry_t *UECapabilityEnquiry,uint8_t eNB_index);
//void rrc_ue_process_securityModeCommand(uint8_t module_idP,uint32_t frame,SecurityModeCommand_t *securityModeCommand,uint8_t eNB_index);
void rrc_eNB_free_UE_index (module_id_t enb_mod_idP, module_id_t ue_mod_idP);
long binary_search_int(int elements[], long numElem, int value);
long binary_search_float(float elements[], long numElem, float value);
+43 -2
View File
@@ -258,6 +258,17 @@ void openair_rrc_top_init(int eMBMS_active, uint8_t cba_group_active,uint8_t HO_
for (module_id=0;module_id<NB_eNB_INST;module_id++) {
eNB_rrc_inst[module_id].num_active_cba_groups = cba_group_active;
}
#endif
#ifdef LOCALIZATION
/* later set this from xml or enb.config file*/
struct timeval ts; // time struct
gettimeofday(&ts, NULL); // get the current epoch timestamp
for (module_id=0;module_id<NB_eNB_INST;module_id++) {
eNB_rrc_inst[module_id].reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
initialize(&eNB_rrc_inst[module_id].loc_list);
eNB_rrc_inst[module_id].loc_type=0;
eNB_rrc_inst[module_id].aggregation_period_ms = 5000;
}
#endif
LOG_D(RRC,
"ALLOCATE %d Bytes for eNB_RRC_INST @ %p\n", (unsigned int)(NB_eNB_INST*sizeof(eNB_RRC_INST)), eNB_rrc_inst);
@@ -318,8 +329,12 @@ void rrc_t310_expiration(const frame_t frameP, uint8_t Mod_id, uint8_t eNB_index
}
}
RRC_status_t rrc_rx_tx(uint8_t Mod_id, const frame_t frameP, const eNB_flag_t eNB_flagP,uint8_t index){
RRC_status_t rrc_rx_tx(uint8_t Mod_id, const frame_t frameP, const eNB_flag_t eNB_flagP,uint8_t index,int CC_id){
uint8_t UE_id;
int32_t current_timestamp_ms, ref_timestamp_ms;
struct timeval ts;
if(eNB_flagP == 0) {
// check timers
@@ -393,8 +408,34 @@ RRC_status_t rrc_rx_tx(uint8_t Mod_id, const frame_t frameP, const eNB_flag_t eN
}
}
else {
else { // eNB
check_handovers(Mod_id,frameP);
// counetr, and get the value and aggregate
#ifdef LOCALIZATION
/* for the localization, only primary CC_id might be relevant*/
gettimeofday(&ts, NULL);
current_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
ref_timestamp_ms = eNB_rrc_inst[Mod_id].reference_timestamp_ms;
for (UE_id=0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if ((current_timestamp_ms - ref_timestamp_ms > eNB_rrc_inst[Mod_id].aggregation_period_ms) &&
rrc_get_estimated_ue_distance(Mod_id,frameP,UE_id, CC_id,eNB_rrc_inst[Mod_id].loc_type) != -1) {
LOG_D(LOCALIZE, " RRC [UE/id %d -> eNB/id %d] timestamp %d frame %d estimated r = %f\n",
UE_id,
Mod_id,
current_timestamp_ms,
frameP,
rrc_get_estimated_ue_distance(Mod_id,frameP,UE_id, CC_id,eNB_rrc_inst[Mod_id].loc_type));
LOG_D(LOCALIZE, " RRC status %d\n", eNB_rrc_inst[Mod_id].Info.UE[UE_id].Status);
push_front(&eNB_rrc_inst[Mod_id].loc_list,
rrc_get_estimated_ue_distance(Mod_id,frameP,UE_id, CC_id,eNB_rrc_inst[Mod_id].loc_type));
eNB_rrc_inst[Mod_id].reference_timestamp_ms = current_timestamp_ms;
}
}
#endif
}
return (RRC_OK);
+14 -5
View File
@@ -142,7 +142,7 @@ int logInit (void)
g_log->log_component[PHY].filelog_name = "/tmp/phy.log";
g_log->log_component[MAC].name = "MAC";
g_log->log_component[MAC].level = LOG_DEBUG;
g_log->log_component[MAC].level = LOG_EMERG;
g_log->log_component[MAC].flag = LOG_MED;
g_log->log_component[MAC].interval = 1;
g_log->log_component[MAC].fd = 0;
@@ -158,7 +158,7 @@ int logInit (void)
g_log->log_component[OPT].filelog_name = "";
g_log->log_component[RLC].name = "RLC";
g_log->log_component[RLC].level = LOG_DEBUG;
g_log->log_component[RLC].level = LOG_INFO;
g_log->log_component[RLC].flag = LOG_MED;
g_log->log_component[RLC].interval = 1;
g_log->log_component[RLC].fd = 0;
@@ -166,7 +166,7 @@ int logInit (void)
g_log->log_component[RLC].filelog_name = "/tmp/rlc.log";
g_log->log_component[PDCP].name = "PDCP";
g_log->log_component[PDCP].level = LOG_DEBUG;
g_log->log_component[PDCP].level = LOG_INFO;
g_log->log_component[PDCP].flag = LOG_MED;
g_log->log_component[PDCP].interval = 1;
g_log->log_component[PDCP].fd = 0;
@@ -212,7 +212,7 @@ int logInit (void)
g_log->log_component[OTG].fd = 0;
g_log->log_component[OTG].filelog = 0;
g_log->log_component[OTG].filelog_name = "/tmp/otg.log";
g_log->log_component[OTG_LATENCY].name = "OTG_LATENCY";
g_log->log_component[OTG_LATENCY].level = LOG_EMERG;
g_log->log_component[OTG_LATENCY].flag = LOG_MED;
@@ -380,7 +380,16 @@ int logInit (void)
g_log->log_component[TMR].fd = 0;
g_log->log_component[TMR].filelog = 0;
g_log->log_component[TMR].filelog_name = "";
/* following log component are used for the localization*/
g_log->log_component[LOCALIZE].name = "LOCALIZE";
g_log->log_component[LOCALIZE].level = LOG_EMERG;
g_log->log_component[LOCALIZE].flag = LOG_MED;
g_log->log_component[LOCALIZE].interval = 1;
g_log->log_component[LOCALIZE].fd = 0;
g_log->log_component[LOCALIZE].filelog = 1;
g_log->log_component[LOCALIZE].filelog_name = "/tmp/localize.log";
g_log->level2string[LOG_EMERG] = "G"; //EMERG
g_log->level2string[LOG_ALERT] = "A"; // ALERT
g_log->level2string[LOG_CRIT] = "C"; // CRITIC
+1
View File
@@ -265,6 +265,7 @@ typedef enum {
RAL_UE,
ENB_APP,
TMR,
LOCALIZE,
MAX_LOG_COMPONENTS,
} comp_name_t;