Commit 376619ba authored by Navid Nikaein's avatar Navid Nikaein

* update for the UE localization functions


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6502 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5f3e2652
...@@ -487,7 +487,8 @@ typedef struct { ...@@ -487,7 +487,8 @@ typedef struct {
/// aggregate physical states every n millisecond /// aggregate physical states every n millisecond
int32_t aggregation_period_ms; int32_t aggregation_period_ms;
/// a set of lists used for localization /// a set of lists used for localization
struct list loc_rss_list, loc_rssi_list, loc_subcarrier_rss_list, loc_timing_advance_list, loc_timing_update_list; struct list loc_rss_list[10], loc_rssi_list[10], loc_subcarrier_rss_list[10], loc_timing_advance_list[10], loc_timing_update_list[10];
struct list tot_loc_rss_list, tot_loc_rssi_list, tot_loc_subcarrier_rss_list, tot_loc_timing_advance_list, tot_loc_timing_update_list;
#endif #endif
} LTE_eNB_ULSCH_t; } LTE_eNB_ULSCH_t;
......
This diff is collapsed.
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
*******************************************************************************/ *******************************************************************************/
/*! \file eNB_scheduler_primitives.c /*! \file eNB_scheduler_RAs.c
* \brief primitives used by eNB for BCH, RACH, ULSCH, DLSCH scheduling * \brief primitives used for random access
* \author Navid Nikaein and Raymond Knopp * \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014 * \date 2010 - 2014
* \email: navid.nikaein@eurecom.fr * \email: navid.nikaein@eurecom.fr
......
...@@ -1144,6 +1144,10 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf ...@@ -1144,6 +1144,10 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
num_sdus = 0; num_sdus = 0;
} }
// if the RLC AM is used, then RLC will only provide 2 bytes for ACK
// in this case, we sould add bsr
// DCCH1 // DCCH1
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH1] == LCID_NOT_EMPTY) { if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH1] == LCID_NOT_EMPTY) {
......
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
#include "asn1_msg.h" #include "asn1_msg.h"
#include "pdcp.h" #include "pdcp.h"
#ifdef LOCALIZATION
#include <sys/time.h>
#endif
#define DEBUG_RRC 1 #define DEBUG_RRC 1
extern eNB_MAC_INST *eNB_mac_inst; extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst; extern UE_MAC_INST *UE_mac_inst;
......
...@@ -304,10 +304,11 @@ del(struct list* z) { ...@@ -304,10 +304,11 @@ del(struct list* z) {
struct node* cur; struct node* cur;
struct node* x = z->head; struct node* x = z->head;
while(x) { while((x != NULL) && (z->size > 0)) {
cur = x; cur = x;
x = x->next; x = x->next;
free(cur); free(cur);
z->size--;
} }
z->head = NULL; z->head = NULL;
...@@ -410,6 +411,7 @@ int compare (const void * a, const void * b) ...@@ -410,6 +411,7 @@ int compare (const void * a, const void * b)
*/ */
int32_t calculate_median(struct list *loc_list) { int32_t calculate_median(struct list *loc_list) {
int32_t median = 0; int32_t median = 0;
if (loc_list->size > 0) {
double* table = (double*) malloc(loc_list->size * sizeof(double)); double* table = (double*) malloc(loc_list->size * sizeof(double));
totable(table, loc_list); totable(table, loc_list);
/// sort the table in ascending way /// sort the table in ascending way
...@@ -419,5 +421,6 @@ int32_t calculate_median(struct list *loc_list) { ...@@ -419,5 +421,6 @@ int32_t calculate_median(struct list *loc_list) {
/// Q3 is the value at 3/4 the sorted table /// Q3 is the value at 3/4 the sorted table
median = table[loc_list->size/2]; median = table[loc_list->size/2];
free(table); free(table);
}
return median; return median;
} }
...@@ -45,6 +45,8 @@ ifeq ($(DEBUG),1) ...@@ -45,6 +45,8 @@ ifeq ($(DEBUG),1)
CFLAGS += -g -ggdb CFLAGS += -g -ggdb
#CFLAGS += -DRRC_MSG_PRINT #CFLAGS += -DRRC_MSG_PRINT
#CFLAGS += -DPDCP_MSG_PRINT #CFLAGS += -DPDCP_MSG_PRINT
else
CFLAGS += -O2
endif endif
ifdef ($(MSG_PRINT),1) ifdef ($(MSG_PRINT),1)
...@@ -58,6 +60,14 @@ ifndef RTAI ...@@ -58,6 +60,14 @@ ifndef RTAI
RTAI=1 RTAI=1
endif endif
ifeq ($(LOCALIZATION), 1)
CFLAGS += -DLOCALIZATION
endif
ifeq ($(LINUX_LIST), 1)
CFLAGS += -DLINUX_LIST
endif
ifeq ($(RTAI),1) ifeq ($(RTAI),1)
CFLAGS += -DENABLE_RTAI_CLOCK CFLAGS += -DENABLE_RTAI_CLOCK
CFLAGS += -DCONFIG_RTAI_LXRT_INLINE #remend the RTAI warning CFLAGS += -DCONFIG_RTAI_LXRT_INLINE #remend the RTAI warning
......
...@@ -3405,6 +3405,10 @@ int main(int argc, char **argv) { ...@@ -3405,6 +3405,10 @@ int main(int argc, char **argv) {
#if defined(ENABLE_SECURITY) #if defined(ENABLE_SECURITY)
set_comp_log(OSA, osa_log_level, osa_log_verbosity, 1); set_comp_log(OSA, osa_log_level, osa_log_verbosity, 1);
#endif #endif
#endif
#ifdef LOCALIZATION
set_comp_log(LOCALIZE, LOG_DEBUG, LOG_LOW, 1);
set_component_filelog(LOCALIZE);
#endif #endif
set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1); set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1);
set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1); set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1);
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <sys/time.h>
#include "init_lte.h" #include "init_lte.h"
...@@ -98,11 +99,19 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -98,11 +99,19 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
struct timeval ts; struct timeval ts;
gettimeofday(&ts, NULL); gettimeofday(&ts, NULL);
PHY_vars_eNB->ulsch_eNB[1+i]->reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000; PHY_vars_eNB->ulsch_eNB[1+i]->reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_rss_list); int j;
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_rssi_list); for (j=0; j<10; j++) {
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_subcarrier_rss_list); initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_rss_list[j]);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_timing_advance_list); initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_rssi_list[j]);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_timing_update_list); initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_subcarrier_rss_list[j]);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_timing_advance_list[j]);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_timing_update_list[j]);
}
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->tot_loc_rss_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->tot_loc_rssi_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->tot_loc_subcarrier_rss_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->tot_loc_timing_advance_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->tot_loc_timing_update_list);
#endif #endif
} }
......
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