Commit 9d8cd129 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.9.0: Updated to support GnuRadio 3.7, added PRACH support to...

Version 0.9.0: Updated to support GnuRadio 3.7, added PRACH support to liblte_phy, cleaned up PRACH support in octave, moved to using socket select with a timeout in libtools, added a new hardware discovery mechanism in LTE_fdd_dl_scan, and added a file recording application
parent edfa9041
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.8.3)
set(openLTE_version 0.9.0)
enable_testing()
#select the release build type by default to get optimization flags
......@@ -47,6 +47,9 @@ endif()
########################################################################
# Find boost
########################################################################
SET(BOOST_REQUIRED_COMPONENTS
system
)
if(UNIX AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
endif(UNIX AND EXISTS "/usr/lib64")
......@@ -59,7 +62,7 @@ set(Boost_ADDITIONAL_VERSIONS
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
)
find_package(Boost "1.35")
find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost required to compile openLTE")
......@@ -85,30 +88,26 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
########################################################################
# Find gnuradio build dependencies
########################################################################
find_package(Gruel)
find_package(GnuradioCore)
set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS PMT)
find_package(Gnuradio "3.7.0")
find_package(GnuradioOsmosdr)
find_package(Rtlsdr)
find_package(HackRf)
if(NOT GRUEL_FOUND)
message(FATAL_ERROR "Gruel required to compile openLTE")
endif()
if(NOT GNURADIO_CORE_FOUND)
message(FATAL_ERROR "GnuRadio Core required to compile openLTE")
if(NOT GNURADIO_RUNTIME_FOUND)
message(FATAL_ERROR "GNURadio required to compile openLTE")
endif()
if(NOT GNURADIO_OSMOSDR_FOUND)
message(FATAL_ERROR "GnuRadio Osmosdr required to compile openLTE (sdr.osmocom.org/trac/)")
message(FATAL_ERROR "GNURadio Osmosdr required to compile openLTE (http://sdr.osmocom.org/trac/wiki/GrOsmoSDR)")
endif()
if(NOT RTLSDR_FOUND)
message(FATAL_ERROR "Rtlsdr required to compile openLTE (sdr.osmocom.org/trac/wiki/rtl-sdr)")
message(FATAL_ERROR "RTLSDR required to compile openLTE (http://sdr.osmocom.org/trac/wiki/rtl-sdr)")
endif()
if(NOT HACKRF_FOUND)
message(FATAL_ERROR "HackRf required to compile openLTE (github.com/mossmann/hackrf/wiki)")
message(FATAL_ERROR "HackRF required to compile openLTE (http://github.com/mossmann/hackrf/wiki)")
endif()
########################################################################
......@@ -116,15 +115,15 @@ endif()
########################################################################
include_directories(
${Boost_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
${GNURADIO_CORE_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${GNURADIO_PMT_INCLUDE_DIRS}
${GNURADIO_OSMOSDR_INCLUDE_DIRS}
)
link_directories(
${Boost_LIBRARY_DIRS}
${GRUEL_LIBRARY_DIRS}
${GNURADIO_CORE_LIBRARY_DIRS}
${GNURADIO_RUNTIME_LIBRARY_DIRS}
${GNURADIO_PMT_LIBRARY_DIRS}
${GNURADIO_OSMOSDR_LIBRARY_DIRS}
)
......@@ -148,3 +147,4 @@ add_subdirectory(libtools)
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)
......@@ -59,3 +59,7 @@ v00.08.02 Fixed two indexing bugs in liblte_phy.cc.
v00.08.03 Added MAC functionality to the LTE library, fixed bugs in RRC portion
of the LTE library, and added hackrf and SIB decode and print support
to the scanner app.
v00.09.00 Updated to support GnuRadio 3.7, added PRACH support to liblte_phy,
cleaned up PRACH support in octave, moved to using a socket select with
a timeout in libtools, added a new hardware discovery mechanism in
LTE_fdd_dl_scan, and added a file recording application.
......@@ -2,7 +2,7 @@
include(GrPlatform)
add_library(LTE_fdd_dl_fg SHARED src/LTE_fdd_dl_fg_samp_buf.cc)
include_directories(hdr ${CMAKE_SOURCE_DIR}/liblte/hdr ${CMAKE_SOURCE_DIR}/cmn_hdr)
target_link_libraries(LTE_fdd_dl_fg lte fftw3f ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
target_link_libraries(LTE_fdd_dl_fg lte fftw3f ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
set_target_properties(LTE_fdd_dl_fg PROPERTIES DEFINE_SYMBOL "LTE_fdd_dl_fg_EXPORTS")
install(TARGETS LTE_fdd_dl_fg LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} RUNTIME DESTINATION bin)
......@@ -14,11 +14,11 @@ if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
endif()
include(GrSwig)
include(GrPython)
foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig)
foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
endforeach(incdir)
foreach(incdir ${GRUEL_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gruel/swig)
foreach(incdir ${GNURADIO_OSMOSDR_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/osmosdr/swig)
endforeach(incdir)
set(GR_SWIG_LIBRARIES LTE_fdd_dl_fg)
GR_SWIG_MAKE(LTE_fdd_dl_fg src/LTE_fdd_dl_fg.i)
......
......@@ -22,7 +22,7 @@
INCLUDES
*******************************************************************************/
#include <gruel/attributes.h>
#include <gnuradio/attributes.h>
/*******************************************************************************
DEFINES
......
......@@ -33,6 +33,7 @@
01/07/2013 Ben Wojtowicz Moved from automake to cmake
03/03/2013 Ben Wojtowicz Added support for a test load.
07/21/2013 Ben Wojtowicz Using the latest LTE library.
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7.
*******************************************************************************/
......@@ -44,9 +45,9 @@
*******************************************************************************/
#include "LTE_fdd_dl_fg_api.h"
#include "gr_sync_block.h"
#include "liblte_phy.h"
#include "liblte_rrc.h"
#include <gnuradio/sync_block.h>
/*******************************************************************************
DEFINES
......@@ -92,7 +93,7 @@ typedef boost::shared_ptr<LTE_fdd_dl_fg_samp_buf> LTE_fdd_dl_fg_samp_buf_sptr;
*******************************************************************************/
LTE_FDD_DL_FG_API LTE_fdd_dl_fg_samp_buf_sptr LTE_fdd_dl_fg_make_samp_buf();
class LTE_FDD_DL_FG_API LTE_fdd_dl_fg_samp_buf : public gr_sync_block
class LTE_FDD_DL_FG_API LTE_fdd_dl_fg_samp_buf : public gr::sync_block
{
public:
~LTE_fdd_dl_fg_samp_buf();
......
#!/usr/bin/env python
from gnuradio import gr
from gnuradio import blocks
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import LTE_fdd_dl_fg
......@@ -23,7 +24,7 @@ class LTE_fdd_dl_file_gen(gr.top_block):
# Build flow graph
self.samp_buf = LTE_fdd_dl_fg.samp_buf()
self.fsink = gr.file_sink(gr.sizeof_char, output_filename)
self.fsink = blocks.file_sink(gr.sizeof_char, output_filename)
self.connect(self.samp_buf, self.fsink)
if __name__ == '__main__':
......
......@@ -37,6 +37,8 @@
03/03/2013 Ben Wojtowicz Added support for a test load and using the
latest libraries.
07/21/2013 Ben Wojtowicz Using the latest LTE library.
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7 and the
latest LTE library.
*******************************************************************************/
......@@ -46,7 +48,7 @@
#include "LTE_fdd_dl_fg_samp_buf.h"
#include "liblte_mac.h"
#include "gr_io_signature.h"
#include <gnuradio/io_signature.h>
#include <errno.h>
/*******************************************************************************
......@@ -79,9 +81,9 @@ LTE_fdd_dl_fg_samp_buf_sptr LTE_fdd_dl_fg_make_samp_buf()
}
LTE_fdd_dl_fg_samp_buf::LTE_fdd_dl_fg_samp_buf()
: gr_sync_block ("samp_buf",
gr_make_io_signature(MIN_IN, MAX_IN, sizeof(int8)),
gr_make_io_signature(MIN_OUT, MAX_OUT, sizeof(int8)))
: gr::sync_block ("samp_buf",
gr::io_signature::make(MIN_IN, MAX_IN, sizeof(int8)),
gr::io_signature::make(MIN_OUT, MAX_OUT, sizeof(int8)))
{
// Initialize the LTE parameters
// General
......@@ -273,7 +275,11 @@ int32 LTE_fdd_dl_fg_samp_buf::work(int32 noutput_items,
N_ant,
N_rb_dl,
LIBLTE_PHY_N_SC_RB_NORMAL_CP,
phich_res);
phich_res,
0,
0,
1,
false);
}
}
free(line);
......@@ -525,11 +531,11 @@ int32 LTE_fdd_dl_fg_samp_buf::work(int32 noutput_items,
// Construct the output
for(p=0; p<N_ant; p++)
{
liblte_phy_create_subframe(phy_struct,
&subframe,
p,
&i_buf[(p*LTE_FDD_DL_FG_SAMP_BUF_SIZE) + (subframe.num*30720)],
&q_buf[(p*LTE_FDD_DL_FG_SAMP_BUF_SIZE) + (subframe.num*30720)]);
liblte_phy_create_dl_subframe(phy_struct,
&subframe,
p,
&i_buf[(p*LTE_FDD_DL_FG_SAMP_BUF_SIZE) + (subframe.num*30720)],
&q_buf[(p*LTE_FDD_DL_FG_SAMP_BUF_SIZE) + (subframe.num*30720)]);
}
}
}else{
......
......@@ -2,7 +2,7 @@
include(GrPlatform)
add_library(LTE_fdd_dl_fs SHARED src/LTE_fdd_dl_fs_samp_buf.cc)
include_directories(hdr ${CMAKE_SOURCE_DIR}/liblte/hdr ${CMAKE_SOURCE_DIR}/cmn_hdr)
target_link_libraries(LTE_fdd_dl_fs lte fftw3f ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
target_link_libraries(LTE_fdd_dl_fs lte fftw3f ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
set_target_properties(LTE_fdd_dl_fs PROPERTIES DEFINE_SYMBOL "LTE_fdd_dl_fs_EXPORTS")
install(TARGETS LTE_fdd_dl_fs LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} RUNTIME DESTINATION bin)
......@@ -14,11 +14,11 @@ if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
endif()
include(GrSwig)
include(GrPython)
foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig)
foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
endforeach(incdir)
foreach(incdir ${GRUEL_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gruel/swig)
foreach(incdir ${GNURADIO_OSMOSDR_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/osmosdr/swig)
endforeach(incdir)
set(GR_SWIG_LIBRARIES LTE_fdd_dl_fs)
GR_SWIG_MAKE(LTE_fdd_dl_fs src/LTE_fdd_dl_fs.i)
......
......@@ -22,7 +22,7 @@
INCLUDES
*******************************************************************************/
#include <gruel/attributes.h>
#include <gnuradio/attributes.h>
/*******************************************************************************
DEFINES
......
......@@ -36,6 +36,7 @@
multiple decodes of the same channel.
03/17/2013 Ben Wojtowicz Added paging message printing.
07/21/2013 Ben Wojtowicz Using the latest LTE library.
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7.
*******************************************************************************/
......@@ -47,9 +48,9 @@
*******************************************************************************/
#include "LTE_fdd_dl_fs_api.h"
#include "gr_sync_block.h"
#include "liblte_phy.h"
#include "liblte_rrc.h"
#include <gnuradio/sync_block.h>
/*******************************************************************************
DEFINES
......@@ -85,7 +86,7 @@ typedef enum{
*******************************************************************************/
LTE_FDD_DL_FS_API LTE_fdd_dl_fs_samp_buf_sptr LTE_fdd_dl_fs_make_samp_buf ();
class LTE_FDD_DL_FS_API LTE_fdd_dl_fs_samp_buf : public gr_sync_block
class LTE_FDD_DL_FS_API LTE_fdd_dl_fs_samp_buf : public gr::sync_block
{
public:
~LTE_fdd_dl_fs_samp_buf();
......
#!/usr/bin/env python
from gnuradio import gr
from gnuradio import blocks
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import LTE_fdd_dl_fs
......@@ -22,7 +23,7 @@ class LTE_fdd_dl_file_scan(gr.top_block):
input_filename = args[0]
# Build flow graph
self.fsrc = gr.file_source(gr.sizeof_char, input_filename, False)
self.fsrc = blocks.file_source(gr.sizeof_char, input_filename, False)
self.samp_buf = LTE_fdd_dl_fs.samp_buf()
self.connect(self.fsrc, self.samp_buf)
......
......@@ -43,6 +43,8 @@
offset correction bug.
03/17/2013 Ben Wojtowicz Added paging message printing.
07/21/2013 Ben Wojtowicz Fixed a bug and using the latest LTE library.
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7 and the
latest LTE library.
*******************************************************************************/
......@@ -53,7 +55,7 @@
#include "LTE_fdd_dl_fs_samp_buf.h"
#include "liblte_mac.h"
#include "liblte_mcc_mnc_list.h"
#include "gr_io_signature.h"
#include <gnuradio/io_signature.h>
/*******************************************************************************
DEFINES
......@@ -95,9 +97,9 @@ LTE_fdd_dl_fs_samp_buf_sptr LTE_fdd_dl_fs_make_samp_buf()
}
LTE_fdd_dl_fs_samp_buf::LTE_fdd_dl_fs_samp_buf()
: gr_sync_block ("samp_buf",
gr_make_io_signature(MIN_IN, MAX_IN, sizeof(int8)),
gr_make_io_signature(MIN_OUT, MAX_OUT, sizeof(int8)))
: gr::sync_block ("samp_buf",
gr::io_signature::make(MIN_IN, MAX_IN, sizeof(int8)),
gr::io_signature::make(MIN_OUT, MAX_OUT, sizeof(int8)))
{
uint32 i;
......@@ -108,7 +110,11 @@ LTE_fdd_dl_fs_samp_buf::LTE_fdd_dl_fs_samp_buf()
4,
LIBLTE_PHY_N_RB_DL_20MHZ,
LIBLTE_PHY_N_SC_RB_NORMAL_CP,
liblte_rrc_phich_resource_num[LIBLTE_RRC_PHICH_RESOURCE_1]);
liblte_rrc_phich_resource_num[LIBLTE_RRC_PHICH_RESOURCE_1],
0,
0,
1,
false);
// Initialize the sample buffer
i_buf = (float *)malloc(LTE_FDD_DL_FS_SAMP_BUF_SIZE*sizeof(float));
......@@ -224,11 +230,11 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
switch(state)
{
case LTE_FDD_DL_FS_SAMP_BUF_STATE_COARSE_TIMING_SEARCH:
if(LIBLTE_SUCCESS == liblte_phy_find_coarse_timing_and_freq_offset(phy_struct,
i_buf,
q_buf,
COARSE_TIMING_N_SLOTS,
&timing_struct))
if(LIBLTE_SUCCESS == liblte_phy_dl_find_coarse_timing_and_freq_offset(phy_struct,
i_buf,
q_buf,
COARSE_TIMING_N_SLOTS,
&timing_struct))
{
if(corr_peak_idx < timing_struct.n_corr_peaks)
{
......@@ -311,14 +317,14 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
}
break;
case LTE_FDD_DL_FS_SAMP_BUF_STATE_BCH_DECODE:
if(LIBLTE_SUCCESS == liblte_phy_get_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
0,
N_id_cell,
4,
&subframe) &&
if(LIBLTE_SUCCESS == liblte_phy_get_dl_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
0,
N_id_cell,
4,
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_bch_channel_decode(phy_struct,
&subframe,
N_id_cell,
......@@ -378,14 +384,14 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
}
break;
case LTE_FDD_DL_FS_SAMP_BUF_STATE_PDSCH_DECODE_SIB1:
if(LIBLTE_SUCCESS == liblte_phy_get_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
5,
N_id_cell,
N_ant,
&subframe) &&
if(LIBLTE_SUCCESS == liblte_phy_get_dl_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
5,
N_id_cell,
N_ant,
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_pdcch_channel_decode(phy_struct,
&subframe,
N_id_cell,
......@@ -424,14 +430,14 @@ int32 LTE_fdd_dl_fs_samp_buf::work(int32 ninput_items,
}
break;
case LTE_FDD_DL_FS_SAMP_BUF_STATE_PDSCH_DECODE_SI_GENERIC:
if(LIBLTE_SUCCESS == liblte_phy_get_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
N_sfr,
N_id_cell,
N_ant,
&subframe) &&
if(LIBLTE_SUCCESS == liblte_phy_get_dl_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
N_sfr,
N_id_cell,
N_ant,
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_pdcch_channel_decode(phy_struct,
&subframe,
N_id_cell,
......
......@@ -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_system ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES})
target_link_libraries(LTE_fdd_dl_scan lte fftw3f 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)
......@@ -26,6 +26,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.
*******************************************************************************/
......@@ -39,8 +40,8 @@
#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>
#include <gnuradio/top_block.h>
#include <osmosdr/source.h>
/*******************************************************************************
DEFINES
......@@ -89,8 +90,8 @@ private:
static void* run_thread(void *inputs);
// Variables
gr_top_block_sptr top_block;
osmosdr_source_c_sptr samp_src;
gr::top_block_sptr top_block;
osmosdr::source::sptr samp_src;
LTE_fdd_dl_scan_state_machine_sptr state_machine;
pthread_t start_thread;
......
......@@ -26,6 +26,7 @@
---------- ------------- --------------------------------------------
02/26/2013 Ben Wojtowicz Created file
07/21/2013 Ben Wojtowicz Added support for multiple sample rates
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7.
*******************************************************************************/
......@@ -38,9 +39,9 @@
#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"
#include <gnuradio/sync_block.h>
/*******************************************************************************
DEFINES
......@@ -74,7 +75,7 @@ typedef enum{
*******************************************************************************/
LTE_FDD_DL_SCAN_STATE_MACHINE_API LTE_fdd_dl_scan_state_machine_sptr LTE_fdd_dl_scan_make_state_machine (uint32 samp_rate);
class LTE_FDD_DL_SCAN_STATE_MACHINE_API LTE_fdd_dl_scan_state_machine : public gr_sync_block
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();
......
......@@ -22,7 +22,7 @@
INCLUDES
*******************************************************************************/
#include <gruel/attributes.h>
#include <gnuradio/attributes.h>
/*******************************************************************************
DEFINES
......
......@@ -26,6 +26,8 @@
---------- ------------- --------------------------------------------
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 and added a
new hardware discovery mechanism.
*******************************************************************************/
......@@ -108,25 +110,28 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
LTE_fdd_dl_scan_interface *interface = LTE_fdd_dl_scan_interface::get_instance();
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;
std::vector<double> range;
if(!started)
{
if(NULL == top_block.get())
{
top_block = gr_make_top_block("top");
top_block = gr::make_top_block("top");
}
if(NULL == samp_src.get())
{
samp_src = osmosdr_make_source_c();
if(0 != samp_src->get_num_channels())
osmosdr::source::sptr tmp_src1 = osmosdr::source::make("hackrf");
if(0 != tmp_src1->get_sample_rates().size())
{
range = samp_src->get_sample_rates().values();
if(range[range.size()-1] == 20000000)
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_HACKRF;
samp_src = tmp_src1;
}else{
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_HACKRF;
}else if(range[range.size()-1] == 2400000){
hardware_type = LTE_FDD_DL_SCAN_HW_TYPE_RTL_SDR;
samp_src = tmp_src2;
}else{
samp_src = osmosdr::source::make();
}
}
}
......@@ -158,7 +163,7 @@ LTE_FDD_DL_SCAN_STATUS_ENUM LTE_fdd_dl_scan_flowgraph::start(uint16 dl_earfcn)
samp_src->set_sample_rate(15360000);
samp_src->set_gain_mode(false);
samp_src->set_gain(14);
samp_src->set_dc_offset_mode(osmosdr_source_c::DCOffsetAutomatic);
samp_src->set_dc_offset_mode(osmosdr::source::DCOffsetAutomatic);
break;
case LTE_FDD_DL_SCAN_HW_TYPE_UNKNOWN:
default:
......
......@@ -27,6 +27,8 @@
02/26/2013 Ben Wojtowicz Created file
07/21/2013 Ben Wojtowicz Added support for multiple sample rates and
for decoding SIBs.
08/26/2013 Ben Wojtowicz Updates to support GnuRadio 3.7 and the
latest LTE library.
*******************************************************************************/
......@@ -37,7 +39,7 @@
#include "LTE_fdd_dl_scan_state_machine.h"
#include "LTE_fdd_dl_scan_flowgraph.h"
#include "liblte_mac.h"
#include "gr_io_signature.h"
#include <gnuradio/io_signature.h>
/*******************************************************************************
DEFINES
......@@ -96,9 +98,9 @@ LTE_fdd_dl_scan_state_machine_sptr LTE_fdd_dl_scan_make_state_machine(uint32 sam
}
LTE_fdd_dl_scan_state_machine::LTE_fdd_dl_scan_state_machine(uint32 samp_rate)
: gr_sync_block ("LTE_fdd_dl_scan_state_machine",
gr_make_io_signature(MIN_IN, MAX_IN, sizeof(gr_complex)),
gr_make_io_signature(MIN_OUT, MAX_OUT, sizeof(gr_complex)))
: gr::sync_block ("LTE_fdd_dl_scan_state_machine",
gr::io_signature::make(MIN_IN, MAX_IN, sizeof(gr_complex)),
gr::io_signature::make(MIN_OUT, MAX_OUT, sizeof(gr_complex)))
{
uint32 i;
......@@ -111,7 +113,11 @@ LTE_fdd_dl_scan_state_machine::LTE_fdd_dl_scan_state_machine(uint32 samp_rate)
4,
LIBLTE_PHY_N_RB_DL_1_4MHZ,
LIBLTE_PHY_N_SC_RB_NORMAL_CP,
liblte_rrc_phich_resource_num[LIBLTE_RRC_PHICH_RESOURCE_1]);
liblte_rrc_phich_resource_num[LIBLTE_RRC_PHICH_RESOURCE_1],
0,
0,
1,
false);
one_subframe_num_samps = ONE_SUBFRAME_NUM_SAMPS_1_92MHZ;
one_frame_num_samps = ONE_FRAME_NUM_SAMPS_1_92MHZ;
freq_change_wait_num_samps = FREQ_CHANGE_WAIT_NUM_SAMPS_1_92MHZ;
......@@ -128,7 +134,11 @@ LTE_fdd_dl_scan_state_machine::LTE_fdd_dl_scan_state_machine(uint32 samp_rate)
4,
LIBLTE_PHY_N_RB_DL_10MHZ,
LIBLTE_PHY_N_SC_RB_NORMAL_CP,
liblte_rrc_phich_resource_num[LIBLTE_RRC_PHICH_RESOURCE_1]);
liblte_rrc_phich_resource_num[LIBLTE_RRC_PHICH_RESOURCE_1],
0,
0,
1,
false);
one_subframe_num_samps = ONE_SUBFRAME_NUM_SAMPS_15_36MHZ;
one_frame_num_samps = ONE_FRAME_NUM_SAMPS_15_36MHZ;
freq_change_wait_num_samps = FREQ_CHANGE_WAIT_NUM_SAMPS_15_36MHZ;
......@@ -229,11 +239,11 @@ int32 LTE_fdd_dl_scan_state_machine::work(int32 ninput_item
switch(state)
{
case LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_COARSE_TIMING_SEARCH:
if(LIBLTE_SUCCESS == liblte_phy_find_coarse_timing_and_freq_offset(phy_struct,
i_buf,
q_buf,
COARSE_TIMING_N_SLOTS,
&timing_struct))
if(LIBLTE_SUCCESS == liblte_phy_dl_find_coarse_timing_and_freq_offset(phy_struct,
i_buf,
q_buf,
COARSE_TIMING_N_SLOTS,
&timing_struct))
{
if(corr_peak_idx < timing_struct.n_corr_peaks)
{
......@@ -339,14 +349,14 @@ int32 LTE_fdd_dl_scan_state_machine::work(int32 ninput_item
}
break;
case LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_BCH_DECODE:
if(LIBLTE_SUCCESS == liblte_phy_get_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
0,
chan_data.N_id_cell,
4,
&subframe) &&
if(LIBLTE_SUCCESS == liblte_phy_get_dl_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
0,
chan_data.N_id_cell,
4,
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_bch_channel_decode(phy_struct,
&subframe,
chan_data.N_id_cell,
......@@ -429,14 +439,14 @@ int32 LTE_fdd_dl_scan_state_machine::work(int32 ninput_item
}
break;
case LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_PDSCH_DECODE_SIB1:
if(LIBLTE_SUCCESS == liblte_phy_get_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
5,
chan_data.N_id_cell,
N_ant,
&subframe) &&
if(LIBLTE_SUCCESS == liblte_phy_get_dl_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
5,
chan_data.N_id_cell,
N_ant,
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_pdcch_channel_decode(phy_struct,
&subframe,
chan_data.N_id_cell,
......@@ -486,14 +496,14 @@ int32 LTE_fdd_dl_scan_state_machine::work(int32 ninput_item
}
break;
case LTE_FDD_DL_SCAN_STATE_MACHINE_STATE_PDSCH_DECODE_SI_GENERIC:
if(LIBLTE_SUCCESS == liblte_phy_get_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
N_sfr,
chan_data.N_id_cell,
N_ant,
&subframe) &&
if(LIBLTE_SUCCESS == liblte_phy_get_dl_subframe_and_ce(phy_struct,
i_buf,
q_buf,
samp_buf_r_idx,
N_sfr,
chan_data.N_id_cell,
N_ant,
&subframe) &&
LIBLTE_SUCCESS == liblte_phy_pdcch_channel_decode(phy_struct,
&subframe,
chan_data.N_id_cell,
......