Commit 3a2fc9c4 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.8.0: Added a scanner application using rtl-sdr, updated the lte...

Version 0.8.0: Added a scanner application using rtl-sdr, updated the lte library, added a tools library, and updated the file scan and generator apps.
parent 0aa1127b
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.7.1)
set(openLTE_version 0.8.0)
enable_testing()
#select the release build type by default to get optimization flags
......@@ -87,6 +87,8 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
########################################################################
find_package(Gruel)
find_package(GnuradioCore)
find_package(GnuradioOsmosdr)
find_package(Rtlsdr)
if(NOT GRUEL_FOUND)
message(FATAL_ERROR "Gruel required to compile openLTE")
......@@ -96,6 +98,14 @@ if(NOT GNURADIO_CORE_FOUND)
message(FATAL_ERROR "GnuRadio Core required to compile openLTE")
endif()
if(NOT GNURADIO_OSMOSDR_FOUND)
message(FATAL_ERROR "GnuRadio Osmosdr required to compile openLTE")
endif()
if(NOT RTLSDR_FOUND)
message(FATAL_ERROR "Rtlsdr required to compile openLTE")
endif()
########################################################################
# Setup the include and linker paths
########################################################################
......@@ -103,12 +113,14 @@ include_directories(
${Boost_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
${GNURADIO_CORE_INCLUDE_DIRS}
${GNURADIO_OSMOSDR_INCLUDE_DIRS}
)
link_directories(
${Boost_LIBRARY_DIRS}
${GRUEL_LIBRARY_DIRS}
${GNURADIO_CORE_LIBRARY_DIRS}
${GNURADIO_OSMOSDR_LIBRARY_DIRS}
)
########################################################################
......@@ -127,5 +139,7 @@ add_custom_target(uninstall
# Add subdirectories
########################################################################
add_subdirectory(liblte)
add_subdirectory(libtools)
add_subdirectory(LTE_fdd_dl_file_gen)
add_subdirectory(LTE_fdd_dl_file_scan)
add_subdirectory(LTE_fdd_dl_scan)
......@@ -45,3 +45,11 @@ v00.06.05 Added SIB3, SIB4, and SIB8 support to the file_gen app, fixed a bu
in the PHICH mapping, fixed the file size bug with the file_gen app,
and pulled in a patch for 64 bit support.
v00.07.00 Moved from automake to cmake.
v00.07.01 Added -fPIC to compile flags and updated README.
v00.08.00 Added a scanner application with support for rtl-sdr hardware.
Changed the lte library to support multiple sampling rates, integer
frequency offset detection, more RRC message/IE packing/unpacking,
interface and network name resolution routines. Added a tools
library with support for socket wrapping. Added test loading
to the file scan and generator apps. Fixed bugs in the file scan
application.
......@@ -31,6 +31,7 @@
12/26/2012 Ben Wojtowicz Added SIB3, SIB4, and SIB8 support and fixed
a file size bug
01/07/2013 Ben Wojtowicz Moved from automake to cmake
03/03/2013 Ben Wojtowicz Added support for a test load.
*******************************************************************************/
......@@ -71,6 +72,7 @@
#define NEIGH_CELL_LIST_PARAM "neigh_cell_list"
#define SIB8_PRESENT_PARAM "sib8_present"
#define SEARCH_WIN_SIZE_PARAM "search_win_size"
#define PERCENT_LOAD_PARAM "percent_load"
/*******************************************************************************
FORWARD DECLARATIONS
......@@ -133,10 +135,10 @@ private:
uint32 N_id_1;
uint32 N_id_2;
uint32 N_rb_dl;
uint32 FFT_pad_size;
uint32 si_periodicity_T;
uint32 si_win_len;
uint32 sib_tx_mode;
uint32 percent_load;
uint8 N_ant;
uint8 sib3_present;
uint8 sib4_present;
......
......@@ -30,6 +30,10 @@
11/10/2012 Ben Wojtowicz Using the latest libraries to decode more
than 1 eNB
01/07/2013 Ben Wojtowicz Moved from automake to cmake
03/03/2013 Ben Wojtowicz Added support for paging channel, SIB5, SIB6,
and SIB7 decoding, using the latest
libraries, and fixed a bug that allowed
multiple decodes of the same channel.
*******************************************************************************/
......@@ -51,6 +55,8 @@
#define LTE_FDD_DL_FS_SAMP_BUF_SIZE (307200*10)
#define LTE_FDD_DL_FS_SAMP_BUF_N_DECODED_CHANS_MAX 10
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
......@@ -97,6 +103,7 @@ private:
LIBLTE_RRC_MSG_STRUCT rrc_msg;
LIBLTE_RRC_MIB_STRUCT mib;
LIBLTE_RRC_BCCH_DLSCH_MSG_STRUCT bcch_dlsch_msg;
LIBLTE_RRC_PCCH_MSG_STRUCT pcch_msg;
// Sample buffer
float *i_buf;
......@@ -107,16 +114,15 @@ private:
// Variables
LTE_FDD_DL_FS_SAMP_BUF_STATE_ENUM state;
float freq_offset;
float phich_res;
uint32 N_rb_dl;
uint32 FFT_pad_size;
uint32 sfn;
uint32 N_sfr;
uint32 N_id_cell;
uint32 N_id_1;
uint32 N_id_2;
uint32 corr_peak_idx;
uint32 decoded_chans[LTE_FDD_DL_FS_SAMP_BUF_N_DECODED_CHANS_MAX];
uint32 N_decoded_chans;
uint8 N_ant;
uint8 prev_si_value_tag;
bool prev_si_value_tag_valid;
......@@ -127,6 +133,12 @@ private:
bool sib3_expected;
bool sib4_printed;
bool sib4_expected;
bool sib5_printed;
bool sib5_expected;
bool sib6_printed;
bool sib6_expected;
bool sib7_printed;
bool sib7_expected;
bool sib8_printed;
bool sib8_expected;
......@@ -139,6 +151,9 @@ private:
void print_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2);
void print_sib3(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_3_STRUCT *sib3);
void print_sib4(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_4_STRUCT *sib4);
void print_sib5(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_5_STRUCT *sib5);
void print_sib6(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_6_STRUCT *sib6);
void print_sib7(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_7_STRUCT *sib7);
void print_sib8(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_8_STRUCT *sib8);
};
......
This source diff could not be displayed because it is too large. You can view the blob instead.
include(GrPlatform)
include_directories(hdr
${CMAKE_SOURCE_DIR}/liblte/hdr
${CMAKE_SOURCE_DIR}/libtools/hdr
${CMAKE_SOURCE_DIR}/cmn_hdr
)
add_executable(LTE_fdd_dl_scan
src/LTE_fdd_dl_scan_main.cc
src/LTE_fdd_dl_scan_interface.cc
src/LTE_fdd_dl_scan_flowgraph.cc
src/LTE_fdd_dl_scan_state_machine.cc
)
target_link_libraries(LTE_fdd_dl_scan lte fftw3 tools pthread ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_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)
/*******************************************************************************
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_dl_scan_flowgraph.h
Description: Contains all the definitions for the LTE FDD DL Scanner
gnuradio flowgraph.
Revision History
---------- ------------- --------------------------------------------
02/26/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_DL_SCAN_FLOWGRAPH_H__
#define __LTE_FDD_DL_SCAN_FLOWGRAPH_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_dl_scan_interface.h"
#include "LTE_fdd_dl_scan_state_machine.h"
#include <boost/thread/mutex.hpp>
#include <gr_top_block.h>
#include <osmosdr_source_c.h>
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_dl_scan_flowgraph
{
public:
// Singleton
static LTE_fdd_dl_scan_flowgraph* get_instance(void);
static void cleanup(void);
// Flowgraph
bool is_started(void);
LTE_FDD_DL_SCAN_STATUS_ENUM start(uint16 dl_earfcn);
LTE_FDD_DL_SCAN_STATUS_ENUM stop(void);
void update_center_freq(uint16 dl_earfcn);
private:
// Singleton
static LTE_fdd_dl_scan_flowgraph *instance;
LTE_fdd_dl_scan_flowgraph();
~LTE_fdd_dl_scan_flowgraph();
// Run
static void* run_thread(void *inputs);
// Variables
gr_top_block_sptr top_block;
osmosdr_source_c_sptr samp_src;
LTE_fdd_dl_scan_state_machine_sptr state_machine;
pthread_t start_thread;
boost::mutex start_mutex;
bool started;
};
#endif /* __LTE_FDD_DL_SCAN_FLOWGRAPH_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_dl_scan_interface.h
Description: Contains all the definitions for the LTE FDD DL Scanner
interface.
Revision History
---------- ------------- --------------------------------------------
02/26/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_DL_SCAN_INTERFACE_H__
#define __LTE_FDD_DL_SCAN_INTERFACE_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "liblte_interface.h"
#include "liblte_rrc.h"
#include "libtools_socket_wrap.h"
#include <boost/thread/mutex.hpp>
#include <string>
/*******************************************************************************
DEFINES
*******************************************************************************/
#define LTE_FDD_DL_SCAN_DEFAULT_CTRL_PORT 20000
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef enum{
LTE_FDD_DL_SCAN_STATUS_OK = 0,
LTE_FDD_DL_SCAN_STATUS_FAIL,
}LTE_FDD_DL_SCAN_STATUS_ENUM;
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;
float freq_offset;
uint32 N_id_cell;
uint32 sfn;
uint8 N_ant;
bool sib1_present;
bool sib2_present;
bool sib3_present;
bool sib4_present;
bool sib5_present;
bool sib6_present;
bool sib7_present;
bool sib8_present;
}LTE_FDD_DL_SCAN_CHAN_DATA_STRUCT;
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_dl_scan_interface
{
public:
// Singleton
static LTE_fdd_dl_scan_interface* get_instance(void);
static void cleanup(void);
// Communication
void set_ctrl_port(int16 port);
void start_ctrl_port(void);
void stop_ctrl_port(void);
void send_ctrl_msg(std::string msg);
void send_ctrl_info_msg(std::string msg);
void send_ctrl_channel_found_msg(LTE_FDD_DL_SCAN_CHAN_DATA_STRUCT *chan_data);
void send_ctrl_channel_not_found_msg(void);
void send_ctrl_status_msg(LTE_FDD_DL_SCAN_STATUS_ENUM status, std::string msg);
static void handle_ctrl_msg(std::string msg);
static void handle_ctrl_connect(void);
static void handle_ctrl_disconnect(void);
static void handle_ctrl_error(LIBTOOLS_SOCKET_WRAP_ERROR_ENUM err);
boost::mutex ctrl_mutex;
libtools_socket_wrap *ctrl_socket;
int16 ctrl_port;
static bool ctrl_connected;
// Get/Set
bool get_shutdown(void);
// Helpers
LTE_FDD_DL_SCAN_STATUS_ENUM switch_to_next_freq(void);
private:
// Singleton
static LTE_fdd_dl_scan_interface *instance;
LTE_fdd_dl_scan_interface();
~LTE_fdd_dl_scan_interface();
// Handlers
void handle_read(std::string msg);
void handle_write(std::string msg);
void handle_start(void);
void handle_stop(void);
void handle_help(void);
// Reads/Writes
void read_band(void);
void write_band(std::string band_str);
void read_dl_earfcn_list(void);
void write_dl_earfcn_list(std::string dl_earfcn_list_str);
void read_repeat(void);
void write_repeat(std::string repeat_str);
// Variables
boost::mutex dl_earfcn_list_mutex;
LIBLTE_INTERFACE_BAND_ENUM band;
uint16 current_dl_earfcn;
uint16 dl_earfcn_list[65535];
uint16 dl_earfcn_list_size;
uint16 dl_earfcn_list_idx;
bool repeat;
bool shutdown;
};
#endif /* __LTE_FDD_DL_SCAN_INTERFACE_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_dl_scan_state_machine.h
Description: Contains all the definitions for the LTE FDD DL Scanner
state machine block.
Revision History
---------- ------------- --------------------------------------------
02/26/2013 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_DL_SCAN_STATE_MACHINE_H__
#define __LTE_FDD_DL_SCAN_STATE_MACHINE_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_dl_scan_state_machine_api.h"
#include "LTE_fdd_dl_scan_interface.h"
#include "gr_sync_block.h"
#include "liblte_phy.h"
#include "liblte_rrc.h"
/*******************************************************************************
DEFINES
*******************************************************************************/
#define LTE_FDD_DL_SCAN_STATE_MACHINE_N_DECODED_CHANS_MAX 10
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
class LTE_fdd_dl_scan_state_machine;
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef boost::shared_ptr<LTE_fdd_dl_scan_state_machine> LTE_fdd_dl_scan_state_machine_sptr;
typedef enum{
LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_COARSE_TIMING_SEARCH = 0,
LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_PSS_AND_FINE_TIMING_SEARCH,
LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_SSS_SEARCH,
LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_BCH_DECODE,
LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_PDSCH_DECODE_SIB1,
LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_PDSCH_DECODE_SI_GENERIC,
}LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_ENUM;
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
LTE_FDD_DL_SCAN_STATE_MACHINE_API LTE_fdd_dl_scan_state_machine_sptr LTE_fdd_dl_scan_make_state_machine ();
class LTE_FDD_DL_SCAN_STATE_MACHINE_API LTE_fdd_dl_scan_state_machine : public gr_sync_block
{
public:
~LTE_fdd_dl_scan_state_machine();
int32 work(int32 ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
private:
friend LTE_FDD_DL_SCAN_STATE_MACHINE_API LTE_fdd_dl_scan_state_machine_sptr LTE_fdd_dl_scan_make_state_machine();
LTE_fdd_dl_scan_state_machine();
// LTE library
LIBLTE_PHY_STRUCT *phy_struct;
LIBLTE_PHY_COARSE_TIMING_STRUCT timing_struct;
LIBLTE_RRC_MSG_STRUCT rrc_msg;
LIBLTE_RRC_MIB_STRUCT mib;
LIBLTE_RRC_BCCH_DLSCH_MSG_STRUCT bcch_dlsch_msg;
// Sample buffer
float *i_buf;
float *q_buf;
uint32 samp_buf_w_idx;
uint32 samp_buf_r_idx;
// Variables
LTE_FDD_DL_SCAN_CHAN_DATA_STRUCT chan_data;
LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_ENUM state;
float phich_res;
uint32 N_sfr;
uint32 N_id_1;
uint32 N_id_2;
uint32 corr_peak_idx;
uint32 decoded_chans[LTE_FDD_DL_SCAN_STATE_MACHINE_N_DECODED_CHANS_MAX];
uint32 N_decoded_chans;
uint32 N_attempts;
uint32 N_bch_attempts;
uint32 N_samps_needed;
uint32 freq_change_wait_cnt;
bool freq_change_wait_done;
bool mib_rxed;
bool sib1_rxed;
bool sib2_rxed;
bool sib3_rxed;
bool sib4_rxed;
bool sib5_rxed;
bool sib6_rxed;
bool sib7_rxed;
bool sib8_rxed;
bool send_cnf;
// Helpers
void init(void);
void copy_input_to_samp_buf(const gr_complex *in, int32 ninput_items);
void freq_shift(uint32 start_idx, uint32 num_samps, float freq_offset);
void save_mib(LIBLTE_RRC_MIB_STRUCT *mib);
void save_sib1(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_1_STRUCT *sib1);
void save_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2);
void save_sib3(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_3_STRUCT *sib3);
void save_sib4(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_4_STRUCT *sib4);
void save_sib5(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_5_STRUCT *sib5);
void save_sib6(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_6_STRUCT *sib6);
void save_sib7(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_7_STRUCT *sib7);
void save_sib8(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_8_STRUCT *sib8);
void channel_found(bool &switch_freq, int32 &done_flag);
void channel_not_found(bool &switch_freq, int32 &done_flag);
};
#endif /* __LTE_FDD_DL_SCAN_STATE_MACHINE_H__ */
/*******************************************************************************
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/>.
*******************************************************************************/
#ifndef __LTE_FDD_DL_SCAN_STATE_MACHINE_API_H__
#define __LTE_FDD_DL_SCAN_STATE_MACHINE_API_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include <gruel/attributes.h>
/*******************************************************************************
DEFINES
*******************************************************************************/
#ifdef LTE_fdd_dl_scan_state_machine_EXPORTS
#define LTE_FDD_DL_SCAN_STATE_MACHINE_API __GR_ATTR_EXPORT
#else
#define LTE_FDD_DL_SCAN_STATE_MACHINE_API __GR_ATTR_IMPORT
#endif
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
#endif /* __LTE_FDD_DL_SCAN_STATE_MACHINE_API_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_dl_scan_flowgraph.cc
Description: Contains all the implementations for the LTE FDD DL Scanner
gnuradio flowgraph.
Revision History
---------- ------------- --------------------------------------------
02/26/2013 Ben Wojtowicz Created file
*******************************************************************************/
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_dl_scan_flowgraph.h"
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
/*******************************************************************************
GLOBAL VARIABLES
*******************************************************************************/
LTE_fdd_dl_scan_flowgraph* LTE_fdd_dl_scan_flowgraph::instance = NULL;
boost::mutex flowgraph_instance_mutex;
/*******************************************************************************
CLASS IMPLEMENTATIONS
*******************************************************************************/
// Singleton
LTE_fdd_dl_scan_flowgraph* LTE_fdd_dl_scan_flowgraph::get_instance(void)
{
boost::mutex::scoped_lock lock(flowgraph_instance_mutex);
if(NULL == instance)
{
instance = new LTE_fdd_dl_scan_flowgraph();
}
return(instance);
}
void LTE_fdd_dl_scan_flowgraph::cleanup(void)
{
boost::mutex::scoped_lock lock(flowgraph_instance_mutex);
if(NULL != instance)
{
delete instance;
instance = NULL;
}
}
// Constructor/Destructor
LTE_fdd_dl_scan_flowgraph::LTE_fdd_dl_scan_flowgraph()
{
started = false;
}
LTE_fdd_dl_scan_flowgraph::~LTE_fdd_dl_scan_flowgraph()
{
boost::mutex::scoped_lock lock(start_mutex);
if(started)
{
start_mutex.unlock();
stop();
}
}