Commit 44f49959 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.10.0: Added LTE_fdd_enodeb application using a USRP B2X0 currently...

Version 0.10.0: Added LTE_fdd_enodeb application using a USRP B2X0 currently with DL transmit only, added support for USRP B2X0 in LTE_fdd_dl_scan and LTE_file_recorder, and fixed a bug generating the references for the second slot in lte_generate_dmrs_pusch.m
parent 7bdbd161
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.9.2)
set(openLTE_version 0.10.0)
enable_testing()
#select the release build type by default to get optimization flags
......@@ -93,6 +93,7 @@ find_package(Gnuradio "3.7.0")
find_package(GnuradioOsmosdr)
find_package(Rtlsdr)
find_package(HackRf)
find_package(Uhd)
find_package(FFTW3F)
if(NOT GNURADIO_RUNTIME_FOUND)
......@@ -111,6 +112,10 @@ if(NOT HACKRF_FOUND)
message(FATAL_ERROR "HackRF required to compile openLTE (http://github.com/mossmann/hackrf/wiki)")
endif()
if(NOT UHD_FOUND)
message(FATAL_ERROR "UHD required to compile openLTE (http://code.ettus.com/redmine/ettus/projects/uhd/wiki)")
endif()
if(NOT FFTW3F_FOUND)
message(FATAL_ERROR "FFTW3 required to compile openLTE")
endif()
......@@ -124,6 +129,8 @@ include_directories(
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${GNURADIO_PMT_INCLUDE_DIRS}
${GNURADIO_OSMOSDR_INCLUDE_DIRS}
${GR_UHD_INCLUDE_DIRS}
${UHD_INCLUDE_DIRS}
)
link_directories(
......@@ -132,6 +139,7 @@ link_directories(
${GNURADIO_RUNTIME_LIBRARY_DIRS}
${GNURADIO_PMT_LIBRARY_DIRS}
${GNURADIO_OSMOSDR_LIBRARY_DIRS}
${UHD_LIBRARY_DIRS}
)
########################################################################
......@@ -155,3 +163,4 @@ add_subdirectory(LTE_fdd_dl_file_gen)
add_subdirectory(LTE_fdd_dl_file_scan)
add_subdirectory(LTE_fdd_dl_scan)
add_subdirectory(LTE_file_recorder)
add_subdirectory(LTE_fdd_enodeb)
......@@ -74,3 +74,7 @@ v00.09.02 Added support for setting the sample rate and output data type in
LTE_fdd_dl_file_scan, and LTE_file_recorder applications compatible,
added uplink demodulation reference signal generation to the octave
code.
v00.10.00 Added LTE_fdd_enodeb application using a USRP B2X0 currently with
DL transmit only, added support for USRP B2X0 in LTE_fdd_dl_scan
and LTE_file_recorder, and fixed a bug genererating the references
for the second slot in lte_generate_dmrs_pusch.m.
......@@ -10,6 +10,6 @@ add_executable(LTE_fdd_dl_scan
src/LTE_fdd_dl_scan_flowgraph.cc
src/LTE_fdd_dl_scan_state_machine.cc
)
target_link_libraries(LTE_fdd_dl_scan lte fftw3f tools pthread ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
target_link_libraries(LTE_fdd_dl_scan lte fftw3f uhd tools pthread ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
set_target_properties(LTE_fdd_dl_scan PROPERTIES DEFINE_SYMBOL "LTE_fdd_dl_scan_state_machine_EXPORTS")
install(TARGETS LTE_fdd_dl_scan DESTINATION bin)
......@@ -27,6 +27,7 @@
02/26/2013 Ben Wojtowicz Created file
07/21/2013 Ben Wojtowicz Added support for HackRF Jawbreaker
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7.
11/13/2013 Ben Wojtowicz Added support for USRP B2X0.
*******************************************************************************/
......@@ -60,6 +61,7 @@
typedef enum{
LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR = 0,
LTE_FDD_DL_SCAN_HW_TYPE_HACKRF,
LTE_FDD_DL_SCAN_HW_TYPE_USRP,
LTE_FDD_DL_SCAN_HW_TYPE_UNKNOWN,
}LTE_FDD_DL_SCAN_HW_TYPE_ENUM;
......
......@@ -28,6 +28,7 @@
07/21/2013 Ben Wojtowicz Added support for HackRF Jawbreaker
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7 and added a
new hardware discovery mechanism.
11/13/2013 Ben Wojtowicz Added support for USRP B2X0.
*******************************************************************************/
......@@ -36,6 +37,7 @@
*******************************************************************************/
#include "LTE_fdd_dl_scan_flowgraph.h"
#include "uhd/usrp/multi_usrp.hpp"
/*******************************************************************************
DEFINES
......@@ -107,9 +109,11 @@ bool LTE_fdd_dl_scan_flowgraph::is_started(void)
LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
{
boost::mutex::scoped_lock lock(start_mutex);
LTE_fdd_dl_scan_interface *interface = LTE_fdd_dl_scan_interface::get_instance();
LTE_fdd_dl_scan_interface *interface = LTE_fdd_dl_scan_interface::get_instance();
uhd::device_addr_t hint;
LTE_FDD_DL_SCAN_STATUS_ENUM err = LTE_FDD_DL_SCAN_STATUS_FAIL;
LTE_FDD_DL_SCAN_HW_TYPE_ENUM hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_UNKNOWN;
double mcr;
if(!started)
{
......@@ -119,19 +123,32 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
}
if(NULL == samp_src.get())
{
osmosdr::source::sptr tmp_src1 = osmosdr::source::make("hackrf");
if(0 != tmp_src1->get_sample_rates().size())
osmosdr::source::sptr tmp_src0 = osmosdr::source::make("uhd");
BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_HACKRF;
samp_src = tmp_src1;
uhd::usrp::multi_usrp::make(dev)->set_master_clock_rate(30720000);
mcr = uhd::usrp::multi_usrp::make(dev)->get_master_clock_rate();
}
if(0 != tmp_src0->get_sample_rates().size() &&
1 >= fabs(mcr - 30720000))
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_USRP;
samp_src = tmp_src0;
}else{
osmosdr::source::sptr tmp_src2 = osmosdr::source::make("rtl=0");
if(0 != tmp_src2->get_sample_rates().size())
osmosdr::source::sptr tmp_src1 = osmosdr::source::make("hackrf");
if(0 != tmp_src1->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR;
samp_src = tmp_src2;
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_HACKRF;
samp_src = tmp_src1;
}else{
samp_src = osmosdr::source::make();
osmosdr::source::sptr tmp_src2 = osmosdr::source::make("rtl=0");
if(0 != tmp_src2->get_sample_rates().size())
{
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR;
samp_src = tmp_src2;
}else{
samp_src = osmosdr::source::make();
}
}
}
}
......@@ -139,6 +156,9 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
{
switch(hardware_type)
{
case LTE_FDD_DL_SCAN_HW_TYPE_USRP:
state_machine = LTE_fdd_dl_scan_make_state_machine(15360000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_HACKRF:
state_machine = LTE_fdd_dl_scan_make_state_machine(15360000);
break;
......@@ -159,6 +179,12 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
{
switch(hardware_type)
{
case LTE_FDD_DL_SCAN_HW_TYPE_USRP:
samp_src->set_sample_rate(15360000);
samp_src->set_gain_mode(false);
samp_src->set_gain(35);
samp_src->set_bandwidth(10000000);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_HACKRF:
samp_src->set_sample_rate(15360000);
samp_src->set_gain_mode(false);
......
include(GrPlatform)
include_directories(hdr
${CMAKE_SOURCE_DIR}/liblte/hdr
${CMAKE_SOURCE_DIR}/libtools/hdr
${CMAKE_SOURCE_DIR}/cmn_hdr
)
add_executable(LTE_fdd_enodeb
src/LTE_fdd_enb_main.cc
src/LTE_fdd_enb_interface.cc
src/LTE_fdd_enb_cnfg_db.cc
src/LTE_fdd_enb_msgq.cc
src/LTE_fdd_enb_user.cc
src/LTE_fdd_enb_user_mgr.cc
src/LTE_fdd_enb_radio.cc
src/LTE_fdd_enb_phy.cc
src/LTE_fdd_enb_mac.cc
src/LTE_fdd_enb_rlc.cc
src/LTE_fdd_enb_pdcp.cc
src/LTE_fdd_enb_rrc.cc
src/LTE_fdd_enb_mme.cc
)
target_link_libraries(LTE_fdd_enodeb lte fftw3f uhd tools pthread rt ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
install(TARGETS LTE_fdd_enodeb DESTINATION bin)
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_c_rnti_mgr.h
Description: Contains all the definitions for the LTE FDD eNodeB
C-RNTI manager.
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_C_RNTI_MGR_H__
#define __LTE_FDD_ENB_C_RNTI_MGR_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_user.h"
#include "typedefs.h"
#include <boost/thread/mutex.hpp>
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_enb_c_rnti_mgr
{
public:
// Singleton
static LTE_fdd_enb_c_rnti_mgr* get_instance(void);
static void cleanup(void);
// External interface
void add_c_rnti(uint16 c_rnti, LTE_fdd_enb_user *user);
void update_c_rnti_user(uint16 c_rnti, LTE_fdd_enb_user *user);
void del_c_rnti(uint16 c_rnti);
private:
// Singleton
static LTE_fdd_enb_c_rnti_mgr *instance;
LTE_fdd_enb_c_rnti_mgr();
~LTE_fdd_enb_c_rnti_mgr();
// User map
std::map<uint16, LTE_fdd_enb_user*> c_rnti_map;
boost::mutex c_rnti_mutex;
};
#endif /* __LTE_FDD_ENB_C_RNTI_MGR_H__ */
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_cnfg_db.h
Description: Contains all the definitions for the LTE FDD eNodeB
configuration database.
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_CNFG_DB_H__
#define __LTE_FDD_ENB_CNFG_DB_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_interface.h"
#include "liblte_rrc.h"
#include "liblte_phy.h"
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef struct{
LIBLTE_RRC_MIB_STRUCT mib;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_1_STRUCT sib1;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT sib2;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_3_STRUCT sib3;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_4_STRUCT sib4;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_5_STRUCT sib5;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_6_STRUCT sib6;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_7_STRUCT sib7;
LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_8_STRUCT sib8;
LIBLTE_PHY_ALLOCATION_STRUCT sib1_alloc;
LIBLTE_PHY_ALLOCATION_STRUCT sib_alloc[4];
uint32 N_ant;
uint32 N_id_cell;
uint32 N_id_1;
uint32 N_id_2;
uint32 N_rb_dl;
uint32 N_rb_ul;
uint32 N_sc_rb;
uint32 si_periodicity_T;
uint32 si_win_len;
bool sib3_present;
bool sib4_present;
bool sib5_present;
bool sib6_present;
bool sib7_present;
bool sib8_present;
}LTE_FDD_ENB_SYS_INFO_STRUCT;
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_enb_cnfg_db
{
public:
// Singleton
static LTE_fdd_enb_cnfg_db* get_instance(void);
static void cleanup(void);
// Parameter Gets/Sets
LTE_FDD_ENB_ERROR_ENUM set_param(LTE_FDD_ENB_PARAM_ENUM param, int64 value);
LTE_FDD_ENB_ERROR_ENUM set_param(LTE_FDD_ENB_PARAM_ENUM param, double value);
LTE_FDD_ENB_ERROR_ENUM set_param(LTE_FDD_ENB_PARAM_ENUM param, std::string value);
LTE_FDD_ENB_ERROR_ENUM get_param(LTE_FDD_ENB_PARAM_ENUM param, int64 &value);
LTE_FDD_ENB_ERROR_ENUM get_param(LTE_FDD_ENB_PARAM_ENUM param, double &value);
LTE_FDD_ENB_ERROR_ENUM get_param(LTE_FDD_ENB_PARAM_ENUM param, std::string &value);
// MIB/SIB Construction
void construct_sys_info(void);
void get_sys_info(LTE_FDD_ENB_SYS_INFO_STRUCT &_sys_info);
private:
// Singleton
static LTE_fdd_enb_cnfg_db *instance;
LTE_fdd_enb_cnfg_db();
~LTE_fdd_enb_cnfg_db();
// Parameters
std::map<LTE_FDD_ENB_PARAM_ENUM, double> var_map_double;
std::map<LTE_FDD_ENB_PARAM_ENUM, int64> var_map_int64;
std::map<LTE_FDD_ENB_PARAM_ENUM, uint32> var_map_uint32;
// System information
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
};
#endif /* __LTE_FDD_ENB_CNFG_DB_H__ */
This diff is collapsed.
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_mac.h
Description: Contains all the definitions for the LTE FDD eNodeB
medium access control layer.
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_MAC_H__
#define __LTE_FDD_ENB_MAC_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"
#include "liblte_mac.h"
#include <boost/thread/mutex.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
#include <list>
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef struct{
LIBLTE_PHY_ALLOCATION_STRUCT dl_alloc;
LIBLTE_PHY_ALLOCATION_STRUCT ul_alloc;
LIBLTE_MAC_RAR_STRUCT rar;
uint32 fn_combo;
}LTE_FDD_ENB_RAR_SCHED_QUEUE_STRUCT;
typedef struct{
LIBLTE_PHY_ALLOCATION_STRUCT alloc;
uint32 fn_combo;
}LTE_FDD_ENB_DL_SCHED_QUEUE_STRUCT;
typedef struct{
LIBLTE_PHY_ALLOCATION_STRUCT alloc;
uint32 fn_combo;
}LTE_FDD_ENB_UL_SCHED_QUEUE_STRUCT;
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_enb_mac
{
public:
// Singleton
static LTE_fdd_enb_mac* get_instance(void);
static void cleanup(void);
// Start/Stop
void start(void);
void stop(void);
// External interface
void update_sys_info(void);
private:
// Singleton
static LTE_fdd_enb_mac *instance;
LTE_fdd_enb_mac();
~LTE_fdd_enb_mac();
// Start/Stop
boost::mutex start_mutex;
bool started;
// Communication
void handle_phy_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *phy_comm_msgq;
LTE_fdd_enb_msgq *rlc_comm_msgq;
boost::interprocess::message_queue *mac_phy_mq;
boost::interprocess::message_queue *mac_rlc_mq;
// PHY Message Handlers
void handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT *rts);
void handle_prach_decode(LTE_FDD_ENB_PRACH_DECODE_MSG_STRUCT *prach_decode);
void handle_pucch_decode(LTE_FDD_ENB_PUCCH_DECODE_MSG_STRUCT *pucch_decode);
void handle_pusch_decode(LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT *pusch_decode);
// RLC Message Handlers
// Message Parsers
// State Machines
// Message Constructors
void construct_random_access_response(uint8 preamble, uint16 timing_adv, uint32 fn_combo);
// Scheduler
void scheduler(void);
LTE_FDD_ENB_ERROR_ENUM add_to_rar_sched_queue(uint32 fn_combo, LIBLTE_PHY_ALLOCATION_STRUCT *dl_alloc, LIBLTE_PHY_ALLOCATION_STRUCT *ul_alloc, LIBLTE_MAC_RAR_STRUCT *rar);
LTE_FDD_ENB_ERROR_ENUM add_to_dl_sched_queue(uint32 fn_combo, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);
LTE_FDD_ENB_ERROR_ENUM add_to_ul_sched_queue(uint32 fn_combo, LIBLTE_PHY_ALLOCATION_STRUCT *alloc);
boost::mutex rar_sched_queue_mutex;
boost::mutex dl_sched_queue_mutex;
boost::mutex ul_sched_queue_mutex;
std::list<LTE_FDD_ENB_RAR_SCHED_QUEUE_STRUCT*> rar_sched_queue;
std::list<LTE_FDD_ENB_DL_SCHED_QUEUE_STRUCT*> dl_sched_queue;
std::list<LTE_FDD_ENB_UL_SCHED_QUEUE_STRUCT*> ul_sched_queue;
LTE_FDD_ENB_PDSCH_SCHEDULE_MSG_STRUCT sched_dl_subfr[10];
LTE_FDD_ENB_PUSCH_SCHEDULE_MSG_STRUCT sched_ul_subfr[10];
uint8 sched_cur_dl_subfn;
uint8 sched_cur_ul_subfn;
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
// Helpers
uint32 get_n_reserved_prbs(uint32 fn_combo);
};
#endif /* __LTE_FDD_ENB_MAC_H__ */
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_mme.h
Description: Contains all the definitions for the LTE FDD eNodeB
mobility management entity layer.
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_MME_H__
#define __LTE_FDD_ENB_MME_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"
#include <boost/interprocess/ipc/message_queue.hpp>
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_enb_mme
{
public:
// Singleton
static LTE_fdd_enb_mme* get_instance(void);
static void cleanup(void);
// Start/Stop
void start(void);
void stop(void);
// External interface
void update_sys_info(void);
private:
// Singleton
static LTE_fdd_enb_mme *instance;
LTE_fdd_enb_mme();
~LTE_fdd_enb_mme();
// Start/Stop
boost::mutex start_mutex;
bool started;
// Communication
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *rrc_comm_msgq;
boost::interprocess::message_queue *mme_rrc_mq;
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
};
#endif /* __LTE_FDD_ENB_MME_H__ */
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_msgq.h
Description: Contains all the definitions for the LTE FDD eNodeB
message queues.
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_MSGQ_H__
#define __LTE_FDD_ENB_MSGQ_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "liblte_rrc.h"
#include "liblte_phy.h"
#include <boost/interprocess/ipc/message_queue.hpp>
#include <string>
/*******************************************************************************
DEFINES
*******************************************************************************/
#define LTE_FDD_ENB_N_SIB_ALLOCS 7
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef enum{
// Generic Messages
LTE_FDD_ENB_MESSAGE_TYPE_KILL = 0,
// MAC -> PHY Messages
LTE_FDD_ENB_MESSAGE_TYPE_PDSCH_SCHEDULE,
LTE_FDD_ENB_MESSAGE_TYPE_PUSCH_SCHEDULE,
// PHY -> MAC Messages
LTE_FDD_ENB_MESSAGE_TYPE_READY_TO_SEND,
LTE_FDD_ENB_MESSAGE_TYPE_PRACH_DECODE,
LTE_FDD_ENB_MESSAGE_TYPE_PUCCH_DECODE,
LTE_FDD_ENB_MESSAGE_TYPE_PUSCH_DECODE,