aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--CMakeLists.txt372
-rw-r--r--MANIFEST.md2
-rw-r--r--README52
-rw-r--r--README.md92
-rw-r--r--apps/CMakeLists.txt12
-rwxr-xr-xapps/osmocom_fft975
-rwxr-xr-xapps/osmocom_siggen4
-rw-r--r--apps/osmocom_siggen_base.py88
-rwxr-xr-xapps/osmocom_siggen_nogui10
-rwxr-xr-xapps/osmocom_spectrum_sense22
-rw-r--r--cmake/Modules/CMakeParseArgumentsCopy.cmake138
-rw-r--r--cmake/Modules/FindGnuradioFCD.cmake34
-rw-r--r--cmake/Modules/FindGnuradioFCDPP.cmake34
-rw-r--r--cmake/Modules/FindGnuradioFuncube.cmake27
-rw-r--r--cmake/Modules/FindGnuradioIQBalance.cmake29
-rw-r--r--cmake/Modules/FindGnuradioUHD.cmake34
-rw-r--r--cmake/Modules/FindLibAIRSPY.cmake6
-rw-r--r--cmake/Modules/FindLibAIRSPYHF.cmake26
-rw-r--r--cmake/Modules/FindLibHackRF.cmake6
-rw-r--r--cmake/Modules/FindLibOsmoSDR.cmake27
-rw-r--r--cmake/Modules/FindLibXTRX.cmake27
-rw-r--r--cmake/Modules/FindLibbladeRF.cmake4
-rw-r--r--cmake/Modules/GrComponent.cmake115
-rw-r--r--cmake/Modules/GrMiscUtils.cmake519
-rw-r--r--cmake/Modules/GrPlatform.cmake54
-rw-r--r--cmake/Modules/GrPython.cmake242
-rw-r--r--cmake/Modules/GrSwig.cmake248
-rw-r--r--cmake/Modules/GrTest.cmake143
-rw-r--r--cmake/Modules/GrVersion.cmake82
-rw-r--r--cmake/Modules/targetConfig.cmake.in26
-rw-r--r--debian/changelog188
-rw-r--r--debian/compat1
-rw-r--r--debian/control79
-rw-r--r--debian/copyright195
-rw-r--r--debian/gr-osmosdr.install6
-rw-r--r--debian/gr-osmosdr.manpages4
-rw-r--r--debian/libgnuradio-osmosdr0.1.4.install1
-rw-r--r--debian/osmocom_fft.1224
-rw-r--r--debian/osmocom_siggen.1222
-rw-r--r--debian/osmocom_siggen_nogui.1224
-rw-r--r--debian/osmocom_spectrum_sense.1196
-rwxr-xr-xdebian/rules29
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch3
-rw-r--r--docs/CMakeLists.txt8
-rw-r--r--docs/doxygen/CMakeLists.txt3
-rw-r--r--docs/doxygen/Doxyfile.in752
-rw-r--r--docs/doxygen/Doxyfile.swig_doc.in686
-rw-r--r--docs/doxygen/doxyxml/__init__.py6
-rw-r--r--docs/doxygen/doxyxml/base.py21
-rw-r--r--docs/doxygen/doxyxml/doxyindex.py97
-rw-r--r--docs/doxygen/doxyxml/example/Doxyfile1551
-rw-r--r--docs/doxygen/doxyxml/example/aadvark.cc50
-rw-r--r--docs/doxygen/doxyxml/example/aadvark.h44
-rw-r--r--docs/doxygen/doxyxml/example/xml/aadvark_8cc.xml88
-rw-r--r--docs/doxygen/doxyxml/example/xml/aadvark_8h.xml72
-rw-r--r--docs/doxygen/doxyxml/example/xml/classAadvark.xml86
-rw-r--r--docs/doxygen/doxyxml/example/xml/combine.xslt15
-rw-r--r--docs/doxygen/doxyxml/example/xml/compound.xsd814
-rw-r--r--docs/doxygen/doxyxml/example/xml/index.xml17
-rw-r--r--docs/doxygen/doxyxml/example/xml/index.xsd66
-rw-r--r--docs/doxygen/doxyxml/generated/__init__.py1
-rw-r--r--docs/doxygen/doxyxml/generated/compound.py8
-rw-r--r--docs/doxygen/doxyxml/generated/compoundsuper.py40
-rw-r--r--docs/doxygen/doxyxml/generated/index.py6
-rw-r--r--docs/doxygen/doxyxml/generated/indexsuper.py21
-rw-r--r--docs/doxygen/doxyxml/text.py8
-rw-r--r--docs/doxygen/other/group_defs.dox5
-rw-r--r--docs/doxygen/other/main_page.dox7
-rw-r--r--docs/doxygen/pydoc_macros.h19
-rw-r--r--docs/doxygen/swig_doc.py255
-rw-r--r--docs/doxygen/update_pydoc.py346
-rw-r--r--gnuradio-osmosdr.pc.in15
-rw-r--r--grc/CMakeLists.txt33
-rw-r--r--grc/gen_osmosdr_blocks.py838
-rw-r--r--include/osmosdr/CMakeLists.txt8
-rw-r--r--include/osmosdr/pimpl.h6
-rw-r--r--include/osmosdr/sink.h2
-rw-r--r--include/osmosdr/source.h3
-rw-r--r--lib/CMakeLists.txt193
-rw-r--r--lib/airspy/CMakeLists.txt25
-rw-r--r--lib/airspy/airspy_source_c.cc3
-rw-r--r--lib/airspy/airspy_source_c.h15
-rw-r--r--lib/airspyhf/CMakeLists.txt37
-rw-r--r--lib/airspyhf/airspyhf_source_c.cc437
-rw-r--r--lib/airspyhf/airspyhf_source_c.h (renamed from lib/osmosdr/osmosdr_src_c.h)103
-rw-r--r--lib/arg_helpers.h13
-rw-r--r--lib/bladerf/CMakeLists.txt26
-rw-r--r--lib/bladerf/bladerf_common.cc63
-rw-r--r--lib/bladerf/bladerf_common.h11
-rw-r--r--lib/bladerf/bladerf_compat.h2
-rw-r--r--lib/bladerf/bladerf_sink_c.cc20
-rw-r--r--lib/bladerf/bladerf_sink_c.h6
-rw-r--r--lib/bladerf/bladerf_source_c.cc27
-rw-r--r--lib/bladerf/bladerf_source_c.h6
-rw-r--r--lib/config.h.in3
-rw-r--r--lib/device.cc57
-rw-r--r--lib/fcd/CMakeLists.txt39
-rw-r--r--lib/fcd/fcd_source_c.cc27
-rw-r--r--lib/fcd/fcd_source_c.h21
-rw-r--r--lib/file/CMakeLists.txt25
-rw-r--r--lib/file/file_sink_c.h2
-rw-r--r--lib/file/file_source_c.h2
-rw-r--r--lib/freesrp/CMakeLists.txt23
-rw-r--r--lib/freesrp/freesrp_common.cc71
-rw-r--r--lib/freesrp/freesrp_common.h3
-rw-r--r--lib/freesrp/freesrp_sink_c.cc101
-rw-r--r--lib/freesrp/freesrp_sink_c.h6
-rw-r--r--lib/freesrp/freesrp_source_c.cc125
-rw-r--r--lib/freesrp/freesrp_source_c.h6
-rw-r--r--lib/gnuradio-osmosdr.rc.in55
-rw-r--r--lib/hackrf/CMakeLists.txt33
-rw-r--r--lib/hackrf/hackrf_common.cc427
-rw-r--r--lib/hackrf/hackrf_common.h113
-rw-r--r--lib/hackrf/hackrf_sink_c.cc427
-rw-r--r--lib/hackrf/hackrf_sink_c.h43
-rw-r--r--lib/hackrf/hackrf_source_c.cc453
-rw-r--r--lib/hackrf/hackrf_source_c.h46
-rw-r--r--lib/miri/CMakeLists.txt23
-rw-r--r--lib/miri/miri_source_c.cc6
-rw-r--r--lib/miri/miri_source_c.h22
-rw-r--r--lib/osmosdr/osmosdr_src_c.cc533
-rw-r--r--lib/ranges.cc13
-rw-r--r--lib/redpitaya/CMakeLists.txt29
-rw-r--r--lib/redpitaya/redpitaya_common.h1
-rw-r--r--lib/redpitaya/redpitaya_sink_c.h2
-rw-r--r--lib/redpitaya/redpitaya_source_c.h2
-rw-r--r--lib/rfspace/CMakeLists.txt20
-rw-r--r--lib/rfspace/rfspace_source_c.cc196
-rw-r--r--lib/rfspace/rfspace_source_c.h40
-rw-r--r--lib/rtl/CMakeLists.txt24
-rw-r--r--lib/rtl/rtl_source_c.cc13
-rw-r--r--lib/rtl/rtl_source_c.h15
-rw-r--r--lib/rtl_tcp/CMakeLists.txt28
-rw-r--r--lib/rtl_tcp/rtl_tcp_source_c.cc13
-rw-r--r--lib/rtl_tcp/rtl_tcp_source_c.h2
-rw-r--r--lib/rtl_tcp/rtl_tcp_source_f.cc327
-rw-r--r--lib/rtl_tcp/rtl_tcp_source_f.h125
-rw-r--r--lib/sdrplay/CMakeLists.txt23
-rw-r--r--lib/sdrplay/sdrplay_source_c.h13
-rw-r--r--lib/sink_iface.h3
-rw-r--r--lib/sink_impl.cc113
-rw-r--r--lib/soapy/CMakeLists.txt23
-rw-r--r--lib/soapy/soapy_common.cc4
-rw-r--r--lib/soapy/soapy_common.h5
-rw-r--r--lib/soapy/soapy_sink_c.cc16
-rw-r--r--lib/soapy/soapy_sink_c.h6
-rw-r--r--lib/soapy/soapy_source_c.cc27
-rw-r--r--lib/soapy/soapy_source_c.h6
-rw-r--r--lib/source_iface.h4
-rw-r--r--lib/source_impl.cc177
-rw-r--r--lib/uhd/CMakeLists.txt26
-rw-r--r--lib/uhd/uhd_sink_c.cc15
-rw-r--r--lib/uhd/uhd_sink_c.h2
-rw-r--r--lib/uhd/uhd_source_c.cc15
-rw-r--r--lib/uhd/uhd_source_c.h2
-rw-r--r--lib/xtrx/CMakeLists.txt (renamed from lib/osmosdr/CMakeLists.txt)20
-rw-r--r--lib/xtrx/xtrx_obj.cc138
-rw-r--r--lib/xtrx/xtrx_obj.h68
-rw-r--r--lib/xtrx/xtrx_sink_c.cc505
-rw-r--r--lib/xtrx/xtrx_sink_c.h129
-rw-r--r--lib/xtrx/xtrx_source_c.cc583
-rw-r--r--lib/xtrx/xtrx_source_c.h127
-rw-r--r--python/CMakeLists.txt20
-rw-r--r--python/__init__.py27
-rw-r--r--python/bindings/CMakeLists.txt33
-rw-r--r--python/bindings/README.md0
-rw-r--r--python/bindings/bind_oot_file.py53
-rw-r--r--python/bindings/device_python.cc27
-rw-r--r--python/bindings/docstrings/README.md1
-rw-r--r--python/bindings/docstrings/sink_pydoc_template.h153
-rw-r--r--python/bindings/docstrings/source_pydoc_template.h162
-rw-r--r--python/bindings/header_utils.py78
-rw-r--r--python/bindings/python_bindings.cc65
-rw-r--r--python/bindings/ranges_python.cc35
-rw-r--r--python/bindings/sink_python.cc320
-rw-r--r--python/bindings/source_python.cc342
-rw-r--r--python/bindings/time_spec_python.cc33
-rw-r--r--swig/CMakeLists.txt57
-rw-r--r--swig/osmosdr_swig.i82
181 files changed, 9271 insertions, 9620 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4c75580
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/.vscode/*
+/build/*
+*.pyc
+*.pyo
diff --git a/CMakeLists.txt b/CMakeLists.txt
index af21291..3a6b0da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,30 +1,32 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
########################################################################
# Project setup
########################################################################
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.8)
project(gr-osmosdr CXX C)
+include(GNUInstallDirs)
enable_testing()
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
+#policy setup
+cmake_policy(SET CMP0011 NEW)
#select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE)
@@ -33,170 +35,206 @@ if(NOT CMAKE_BUILD_TYPE)
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
-set(ENABLE_NONFREE FALSE CACHE BOOL "Enable or disable nonfree components.")
+########################################################################
+# GNURadio setup
+########################################################################
+list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
+
+# Find GNURadio (pmt and runtime are core, always included)
+include(FindPkgConfig)
+find_package(Gnuradio "3.9" REQUIRED COMPONENTS blocks fft filter)
# Set the version information here
-set(VERSION_INFO_MAJOR_VERSION 0)
-set(VERSION_INFO_API_COMPAT 1)
-set(VERSION_INFO_MINOR_VERSION 5)
-set(VERSION_INFO_MAINT_VERSION git)
+set(VERSION_MAJOR 0)
+set(VERSION_API 2)
+set(VERSION_ABI 0)
+set(VERSION_PATCH 0)
include(GrVersion) #setup version info
########################################################################
# Compiler specific setup
########################################################################
-IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|x86")
- SET(USE_SIMD "SSE2" CACHE STRING "Use SIMD instructions")
-ELSE()
- SET(USE_SIMD "no" CACHE STRING "Use SIMD instructions")
-ENDIF()
- SET(USE_SIMD_VALUES "no" "SSE2" "AVX")
- SET_PROPERTY(CACHE USE_SIMD PROPERTY STRINGS ${USE_SIMD_VALUES})
- LIST(FIND USE_SIMD_VALUES ${USE_SIMD} USE_SIMD_INDEX)
- IF(${USE_SIMD_INDEX} EQUAL -1)
- message(FATAL_ERROR "Option ${USE_SIMD} not supported, valid entries are ${USE_SIMD_VALUES}")
- ENDIF()
-
-IF(CMAKE_CXX_COMPILER MATCHES ".*clang")
- SET(CMAKE_COMPILER_IS_CLANGXX 1)
-ENDIF()
-
-IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
- ADD_DEFINITIONS(-Wall)
- ADD_DEFINITIONS(-Wextra)
- ADD_DEFINITIONS(-Wno-unused-parameter)
- ADD_DEFINITIONS(-Wsign-compare)
- #ADD_DEFINITIONS(-Wconversion)
- #ADD_DEFINITIONS(-pedantic)
- #ADD_DEFINITIONS(-ansi)
- IF(NOT WIN32)
- #only export symbols that are declared to be part of the api (non dll platforms)
- ADD_DEFINITIONS(-fvisibility=hidden)
- ADD_DEFINITIONS(-fvisibility-inlines-hidden)
- ENDIF(NOT WIN32)
- IF(USE_SIMD MATCHES SSE2)
- ADD_DEFINITIONS(-msse2)
- ADD_DEFINITIONS(-DUSE_SSE2)
- ENDIF()
- IF(USE_SIMD MATCHES AVX)
- ADD_DEFINITIONS(-march=native)
- ADD_DEFINITIONS(-DUSE_AVX)
- ENDIF()
-ELSEIF(MSVC)
- IF(USE_SIMD MATCHES SSE2)
- ADD_DEFINITIONS(/arch:SSE2)
- ADD_DEFINITIONS(-DUSE_SSE2)
- ENDIF()
- IF(USE_SIMD MATCHES AVX)
- ADD_DEFINITIONS(/arch:AVX)
- ADD_DEFINITIONS(-DUSE_AVX)
- ENDIF()
-ENDIF()
-
-########################################################################
-# Setup boost
-########################################################################
-MESSAGE(STATUS "Configuring Boost C++ Libraries...")
-
-# Although not required on my system, some users have linking issues without
-SET(BOOST_REQUIRED_COMPONENTS
- thread
- system
-)
-
-if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
- list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
-endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
-
-set(Boost_ADDITIONAL_VERSIONS
- "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
- "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
- "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
- "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
- "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
- "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"
-)
+if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
+ CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ AND NOT WIN32)
+ #http://gcc.gnu.org/wiki/Visibility
+ add_definitions(-fvisibility=hidden)
+ add_definitions(-fvisibility-inlines-hidden)
+endif()
-find_package(Boost COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
+set(CMAKE_CXX_STANDARD 11)
+
+# Misc options
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
+ CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ add_definitions(-Wall)
+ add_definitions(-Wextra)
+ add_definitions(-Wno-unused-parameter)
+ add_definitions(-Wsign-compare)
+ #add_definitions(-Wconversion)
+ #add_definitions(-pedantic)
+ #add_definitions(-ansi)
+endif()
-if(NOT Boost_FOUND)
- message(FATAL_ERROR "Boost required to build " ${CMAKE_PROJECT_NAME})
+# SIMD
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|x86")
+ set(USE_SIMD "SSE2" CACHE STRING "Use SIMD instructions")
+else()
+ set(USE_SIMD "no" CACHE STRING "Use SIMD instructions")
+endif()
+set(USE_SIMD_VALUES "no" "SSE2" "AVX")
+set_property(CACHE USE_SIMD PROPERTY STRINGS ${USE_SIMD_VALUES})
+list(FIND USE_SIMD_VALUES ${USE_SIMD} USE_SIMD_INDEX)
+if(${USE_SIMD_INDEX} EQUAL -1)
+ message(FATAL_ERROR "Option ${USE_SIMD} not supported, valid entries are ${USE_SIMD_VALUES}")
endif()
-ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
+ CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if(USE_SIMD MATCHES SSE2)
+ add_definitions(-msse2)
+ add_definitions(-DUSE_SSE2)
+ endif()
+ if(USE_SIMD MATCHES AVX)
+ add_definitions(-march=native)
+ add_definitions(-DUSE_AVX)
+ endif()
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ if(USE_SIMD MATCHES SSE2)
+ add_definitions(/arch:SSE2)
+ add_definitions(-DUSE_SSE2)
+ endif()
+ if(USE_SIMD MATCHES AVX)
+ add_definitions(/arch:AVX)
+ add_definitions(-DUSE_AVX)
+ endif()
+ # boost feels like using lib pragmas to link to libs,
+ # but the boost libs might not even be in the (default) lib search path
+ add_definitions(-DBOOST_ALL_NO_LIB)
+ # macro turns std::min into errors...
+ add_definitions(-DNOMINMAX)
+endif()
########################################################################
-# Install directories
+# Find boost
########################################################################
-include(GrPlatform) #define LIB_SUFFIX
-set(GR_RUNTIME_DIR bin)
-set(GR_LIBRARY_DIR lib${LIB_SUFFIX})
-set(GR_INCLUDE_DIR include)
-set(GR_DATA_DIR share)
-set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME})
-set(GR_DOC_DIR ${GR_DATA_DIR}/doc)
-if (NOT GR_PKG_DOC_DIR)
- set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME})
+find_package(Boost "1.65" REQUIRED chrono thread system)
+
+if(NOT Boost_FOUND)
+ message(FATAL_ERROR "Boost required to compile osmosdr")
endif()
-set(GR_CONF_DIR etc)
-set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d)
-set(GR_LIBEXEC_DIR libexec)
-set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME})
-set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
########################################################################
-# Find build dependencies
+# Find build dependencies and setup options
########################################################################
-set(GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS)
-set(MIN_GR_VERSION "3.7.10")
-find_package(Gnuradio REQUIRED)
-if("${Gnuradio_VERSION}" VERSION_LESS MIN_GR_VERSION)
- MESSAGE(FATAL_ERROR "GnuRadio version required: >=\"" ${MIN_GR_VERSION} "\" found: \"" ${Gnuradio_VERSION} "\"")
-endif()
-find_package(GnuradioIQBalance)
+include(GrComponent)
+
+set(ENABLE_NONFREE FALSE CACHE BOOL "Enable or disable nonfree components.")
+
+
+ # GNURadio components & OOTs
+ ##############################
+
+
+ # Note this is not supposed to be lique that for GR components
+ # but ATM GR's handling of components is broken
+message(STATUS "Searching for GNURadio-Blocks...")
+find_package(gnuradio-blocks PATHS ${Gnuradio_DIR})
+message(STATUS " Found GNURadio-Blocks: ${gnuradio-blocks_FOUND}")
+
+message(STATUS "Searching for IQ Balance...")
+find_package(gnuradio-iqbalance PATHS ${Gnuradio_DIR})
+message (STATUS " Found IQ Balance: ${gnuradio-iqbalance_FOUND}")
+
+message(STATUS "Searching for UHD Drivers...")
find_package(UHD)
-find_package(GnuradioUHD)
-find_package(GnuradioFCD)
-find_package(GnuradioFCDPP)
-find_package(LibOsmoSDR)
+message (STATUS " Found UHD Driver: ${UHD_FOUND}")
+
+message(STATUS "Searching for UHD Block...")
+find_package(gnuradio-uhd PATHS ${Gnuradio_DIR})
+message (STATUS " Found UHD Block: ${gnuradio-uhd_FOUND}")
+
+message(STATUS "Searching for Volk...")
+find_package(Volk REQUIRED)
+message (STATUS " Found Volk: ${Volk_FOUND}")
+
+ # Hardware drivers
+ ####################
+
find_package(LibRTLSDR)
find_package(LibMiriSDR)
if(ENABLE_NONFREE)
-find_package(LibSDRplay)
+ find_package(LibSDRplay)
endif(ENABLE_NONFREE)
find_package(LibHackRF)
find_package(LibAIRSPY)
-find_package(Volk)
+find_package(LibAIRSPYHF)
find_package(LibbladeRF)
+find_package(GnuradioFuncube)
find_package(SoapySDR NO_MODULE)
find_package(LibFreeSRP)
+find_package(LibXTRX)
find_package(Doxygen)
-if(NOT GNURADIO_RUNTIME_FOUND)
- message(FATAL_ERROR "GnuRadio Runtime required to build " ${CMAKE_PROJECT_NAME})
-endif()
+ # Python
+ ##########
+
+find_package(PythonLibs 3)
+find_package(pybind11)
+
+GR_REGISTER_COMPONENT("Python support" ENABLE_PYTHON
+ PYTHONLIBS_FOUND
+ pybind11_FOUND
+)
########################################################################
-# Setup the include and linker paths
+# Install directories
########################################################################
-include_directories(
- ${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/lib
- ${Boost_INCLUDE_DIRS}
- ${GNURADIO_ALL_INCLUDE_DIRS}
-)
+include(GrPlatform) #define LIB_SUFFIX
-link_directories(
- ${Boost_LIBRARY_DIRS}
- ${GNURADIO_ALL_LIBRARY_DIRS}
-)
+if(NOT CMAKE_MODULES_DIR)
+ set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
+endif(NOT CMAKE_MODULES_DIR)
+
+set(GR_INCLUDE_DIR include)
+set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/osmosdr)
+set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME})
+set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME})
+set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d)
+set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME})
+
+########################################################################
+# On Apple only, set install name and use rpath correctly, if not already set
+########################################################################
+if(APPLE)
+ if(NOT CMAKE_INSTALL_NAME_DIR)
+ set(CMAKE_INSTALL_NAME_DIR
+ ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE
+ PATH "Library Install Name Destination Directory" FORCE)
+ endif(NOT CMAKE_INSTALL_NAME_DIR)
+ if(NOT CMAKE_INSTALL_RPATH)
+ set(CMAKE_INSTALL_RPATH
+ ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE
+ PATH "Library Install RPath" FORCE)
+ endif(NOT CMAKE_INSTALL_RPATH)
+ if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE
+ BOOL "Do Build Using Library Install RPath" FORCE)
+ endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
+endif(APPLE)
+
+########################################################################
+# Setup doxygen option
+########################################################################
+find_package(Doxygen)
-# Set component parameters
-set(GR_OSMOSDR_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE)
-set(GR_OSMOSDR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE)
+if(DOXYGEN_FOUND)
+ option(ENABLE_DOXYGEN "Build docs using Doxygen" ON)
+else(DOXYGEN_FOUND)
+ option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
+endif(DOXYGEN_FOUND)
########################################################################
# Create uninstall target
@@ -208,28 +246,7 @@ configure_file(
add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
-)
-
-########################################################################
-# Enable python component
-########################################################################
-find_package(PythonLibs 2)
-find_package(SWIG)
-
-if(SWIG_FOUND)
- message(STATUS "Minimum SWIG version required is 1.3.31")
- set(SWIG_VERSION_CHECK FALSE)
- if("${SWIG_VERSION}" VERSION_GREATER "1.3.30")
- set(SWIG_VERSION_CHECK TRUE)
- endif()
-endif(SWIG_FOUND)
-
-include(GrComponent)
-GR_REGISTER_COMPONENT("Python support" ENABLE_PYTHON
- PYTHONLIBS_FOUND
- SWIG_FOUND
- SWIG_VERSION_CHECK
-)
+ )
########################################################################
# Add subdirectories
@@ -237,7 +254,6 @@ GR_REGISTER_COMPONENT("Python support" ENABLE_PYTHON
add_subdirectory(include/osmosdr)
add_subdirectory(lib)
if(ENABLE_PYTHON)
- add_subdirectory(swig)
add_subdirectory(python)
add_subdirectory(grc)
add_subdirectory(apps)
@@ -245,52 +261,14 @@ endif(ENABLE_PYTHON)
add_subdirectory(docs)
########################################################################
-# Create Pkg Config File
-########################################################################
-FOREACH(inc ${Boost_INCLUDE_DIRS})
- LIST(APPEND GR_OSMOSDR_PC_CFLAGS "-I${inc}")
-ENDFOREACH(inc)
-
-FOREACH(lib ${Boost_LIBRARY_DIRS})
- LIST(APPEND GR_OSMOSDR_PC_LIBS "-L${lib}")
-ENDFOREACH(lib)
-
-# use space-separation format for the pc file
-STRING(REPLACE ";" " " GR_OSMOSDR_PC_REQUIRES "${GR_OSMOSDR_PC_REQUIRES}")
-STRING(REPLACE ";" " " GR_OSMOSDR_PC_CFLAGS "${GR_OSMOSDR_PC_CFLAGS}")
-STRING(REPLACE ";" " " GR_OSMOSDR_PC_LIBS "${GR_OSMOSDR_PC_LIBS}")
-
-# unset these vars to avoid hard-coded paths to cross environment
-IF(CMAKE_CROSSCOMPILING)
- UNSET(GR_OSMOSDR_PC_CFLAGS)
- UNSET(GR_OSMOSDR_PC_LIBS)
-ENDIF(CMAKE_CROSSCOMPILING)
-
-# fake gnuradio cpack behavior as long as we don't use it directly
-set(CPACK_PACKAGE_NAME "gnuradio-osmosdr")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GNU Radio block for various radio hardware")
-set(CPACK_PACKAGE_VERSION ${VERSION})
-
-CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-osmosdr.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-osmosdr.pc
-@ONLY)
-
-INSTALL(
- FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-osmosdr.pc
- DESTINATION ${GR_LIBRARY_DIR}/pkgconfig
-)
-
-########################################################################
# Print Summary
########################################################################
GR_PRINT_COMPONENT_SUMMARY()
if(ENABLE_NONFREE)
-MESSAGE(STATUS
- "NONFREE components have been enabled. The resulting
+ MESSAGE(STATUS
+ "NONFREE components have been enabled. The resulting
binaries cannot be distributed under GPL terms.
- "
-)
+ ")
endif(ENABLE_NONFREE)
MESSAGE(STATUS "Building for version: ${VERSION} / ${LIBVER}")
diff --git a/MANIFEST.md b/MANIFEST.md
index 9e19f5f..1e7c621 100644
--- a/MANIFEST.md
+++ b/MANIFEST.md
@@ -15,7 +15,7 @@ author:
copyright_owner:
- Dimitri Stolnikov <horiz0n@gmx.net>
license: GPLv3
-repo: git://git.osmocom.org/gr-osmosdr
+repo: https://gitea.osmocom.org/sdr/gr-osmosdr
website: http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
---
GNU Radio block for interfacing with various radio hardware
diff --git a/README b/README
deleted file mode 100644
index 67fa475..0000000
--- a/README
+++ /dev/null
@@ -1,52 +0,0 @@
-While primarily being developed for the OsmoSDR hardware, this block
-as well supports:
-
- * FUNcube Dongle through libgnuradio-fcd
- * FUNcube Dongle Pro+ through gr-fcdproplus
- * sysmocom OsmoSDR Devices through libosmosdr
- * RTL2832U based DVB-T dongles through librtlsdr
- * RTL-TCP spectrum server (see librtlsdr project)
- * MSi2500 based DVB-T dongles through libmirisdr
- * SDRplay RSP through SDRplay API library
- * gnuradio .cfile input through libgnuradio-blocks
- * RFSPACE SDR-IQ, SDR-IP, NetSDR (incl. X2 option)
- * AirSpy Wideband Receiver through libairspy
- * CCCamp 2015 rad1o Badge through libhackrf
- * Great Scott Gadgets HackRF through libhackrf
- * Nuand LLC bladeRF through libbladeRF library
- * Ettus USRP Devices through Ettus UHD library
- * Fairwaves UmTRX through Fairwaves' fork of UHD
- * Red Pitaya SDR transceiver (http://bazaar.redpitaya.com)
- * FreeSRP through libfreesrp
-
-By using the OsmoSDR block you can take advantage of a common software api in
-your application(s) independent of the underlying radio hardware.
-
-For installation and usage guidelines please read the documentation available
-at http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
-
-For the impatient :) a short excerpt:
-
-The Gnu Radio block requires a recent gnuradio (>= v3.7) to be installed.
-
-Before building the block you have to make sure that all the dependencies
-(see list of supported devices above) you are intend to work with are
-properly installed. The build system of gr-osmosdr will recognize them and
-enable specific source/sink components thereafter.
-
-Please note: prior pulling a new version from git and compiling it,
-please do a "make uninstall" first to properly remove the previous version.
-
-Building with cmake:
-
-git clone git://git.osmocom.org/gr-osmosdr
-cd gr-osmosdr/
-mkdir build
-cd build/
-cmake ../
-make
-sudo make install
-sudo ldconfig
-
-NOTE: The osmocom blocks will appear under 'Sources' and 'Sinks' categories
-in GRC menu.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..338b5b8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,92 @@
+gr-osmosdr - generic gnuradio SDR I/O block
+===========================================
+
+While originally being developed for the
+[OsmoSDR](https://osmocom.org/projects/osmosdr/wiki) hardware, this
+block has become a generic SDR I/O block for a variety of SDR
+hardware, including:
+
+ * FUNcube Dongle / Pro+ through [gr-funcube](https://github.com/dl1ksv/gr-funcube)
+ * RTL2832U based DVB-T dongles through [librtlsdr](https://osmocom.org/projects/rtl-sdr/wiki)
+ * RTL-TCP spectrum server (see librtlsdr project)
+ * MSi2500 based DVB-T dongles through [libmirisdr](https://gitea.osmocom.org/sdr/libmirisdr)
+ * SDRplay RSP through SDRplay API library
+ * gnuradio .cfile input through libgnuradio-blocks
+ * RFSPACE SDR-IQ, SDR-IP, NetSDR (incl. X2 option), Cloud-IQ, and CloudSDR
+ * AirSpy Wideband Receiver through [libairspy](https://github.com/airspy/airspyone_host)
+ * CCCamp 2015 rad1o Badge through [libhackrf](https://github.com/greatscottgadgets/hackrf)
+ * Great Scott Gadgets HackRF through [libhackrf](https://github.com/greatscottgadgets/hackrf)
+ * Nuand LLC bladeRF through [libbladeRF library](https://www.nuand.com/libbladeRF-doc/)
+ * Ettus USRP Devices through [Ettus UHD library](https://github.com/EttusResearch/uhd)
+ * Fairwaves UmTRX through [Fairwaves' module for UHD](https://github.com/fairwaves/UHD-Fairwaves)
+ * Fairwaves XTRX through [libxtrx](https://github.com/myriadrf/libxtrx)
+ * Red Pitaya SDR transceiver <http://bazaar.redpitaya.com>
+ * FreeSRP through [libfreesrp](https://github.com/myriadrf/libfreesrp)
+
+By using the gr-osmosdr block you can take advantage of a common software API in
+your application(s) independent of the underlying radio hardware.
+
+Homepage + Documentation
+------------------------
+
+For installation and usage guidelines please read the documentation available
+at <https://osmocom.org/projects/gr-osmosdr/wiki>
+
+For the impatient :) a short excerpt:
+
+The Gnu Radio block requires a recent gnuradio (>= v3.7) to be installed.
+
+Before building the block you have to make sure that all the dependencies
+(see list of supported devices above) you are intend to work with are
+properly installed. The build system of gr-osmosdr will recognize them and
+enable specific source/sink components thereafter.
+
+Please note: prior pulling a new version from git and compiling it,
+please do a `make uninstall` first to properly remove the previous version.
+
+Building with cmake:
+```
+git clone https://gitea.osmocom.org/sdr/gr-osmosdr
+cd gr-osmosdr/
+mkdir build
+cd build/
+cmake ../
+make
+sudo make install
+sudo ldconfig
+```
+
+NOTE: The osmocom blocks will appear under *Sources* and *Sinks* categories
+in GRC menu.
+
+Forum
+-----
+
+We welcome any gr-osmosdr related discussions in the
+[SDR](https://discourse.osmocom.org/c/sdr/)
+section of the osmocom discourse (web based Forum).
+
+Mailing List
+------------
+
+Discussions related to libosmocore are happening on the
+osmocom-sdr@lists.osmocom.org mailing list, please see
+<https://lists.osmocom.org/mailman/listinfo/osmocom-sdr> for subscription
+options and the list archive.
+
+Please observe the [Osmocom Mailing List
+Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules)
+when posting.
+
+
+Issue tracker
+-------------
+
+We are using the Osmocom redmine at <https://osmocom.org/projects/gr-osmosdr/issues>
+
+Contributing
+------------
+
+We maintain our source code in a self-hosted instance of gitea at
+<https://gitea.osmocom.org/sdr/gr-osmosdr>. You can send pull requests there, or send
+patches the old-fashioned way (git send-email) to the above-mentioned mailing list.
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
index 9c30a4b..a8af662 100644
--- a/apps/CMakeLists.txt
+++ b/apps/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -28,8 +28,8 @@ GR_PYTHON_INSTALL(
GR_PYTHON_INSTALL(
PROGRAMS
osmocom_fft
- osmocom_siggen
+ # osmocom_siggen
osmocom_siggen_nogui
- osmocom_spectrum_sense
+ # osmocom_spectrum_sense
DESTINATION ${GR_RUNTIME_DIR}
)
diff --git a/apps/osmocom_fft b/apps/osmocom_fft
index da38861..c48ac7e 100755
--- a/apps/osmocom_fft
+++ b/apps/osmocom_fft
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright 2012 Free Software Foundation, Inc.
#
@@ -20,45 +20,71 @@
# Boston, MA 02110-1301, USA.
#
-SAMP_RANGE_KEY = 'samp_range'
-SAMP_RATE_KEY = 'samp_rate'
-GAIN_KEY = lambda x: 'gain:'+x
-BWIDTH_KEY = 'bwidth'
-CENTER_FREQ_KEY = 'center_freq'
-FREQ_CORR_KEY = 'freq_corr'
-FREQ_RANGE_KEY = 'freq_range'
-GAIN_RANGE_KEY = lambda x: 'gain_range:'+x
-BWIDTH_RANGE_KEY = 'bwidth_range'
-
import osmosdr
from gnuradio import blocks
-from gnuradio import gr, gru
+from gnuradio import gr
from gnuradio import eng_notation
-from gnuradio.gr.pubsub import pubsub
+from gnuradio.fft import window
from gnuradio.eng_option import eng_option
from optparse import OptionParser
+from functools import partial
import sys
-import numpy
+import signal
import time
import datetime
try:
- from gnuradio.wxgui import stdgui2, form, slider
- from gnuradio.wxgui import forms
- from gnuradio.wxgui import fftsink2, waterfallsink2, scopesink2
- import wx
+ from PyQt5 import Qt
+ from gnuradio import qtgui
+ import sip
+ from gnuradio.qtgui import Range, RangeWidget
except ImportError:
- sys.stderr.write("Error importing GNU Radio's wxgui. Please make sure gr-wxgui is installed.\n")
+ sys.stderr.write("Error importing GNU Radio's Qtgui.\n")
sys.exit(1)
-class app_top_block(stdgui2.std_top_block, pubsub):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
- pubsub.__init__(self)
- self.frame = frame
- self.panel = panel
+class CallEvent(Qt.QEvent):
+ """An event containing a request for a function call."""
+ EVENT_TYPE = Qt.QEvent.Type(Qt.QEvent.registerEventType())
+
+ def __init__(self, fn, *args, **kwargs):
+ Qt.QEvent.__init__(self, self.EVENT_TYPE)
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+
+class freq_recv(gr.sync_block, Qt.QObject):
+ def __init__(self, callback):
+ gr.sync_block.__init__(self, name="freq_recv", in_sig=None, out_sig=None)
+ Qt.QObject.__init__(self)
+
+ self.set_freq=callback
+
+ # Advertise 'msg' port
+ self.message_port_register_in(gr.pmt.intern('msg'))
+ self.set_msg_handler(gr.pmt.intern('msg'), self.handle_msg)
+
+ def handle_msg(self, msg_pmt):
+ # Unpack message & call set_freq on main thread
+ meta = gr.pmt.to_python(gr.pmt.car(msg_pmt))
+ msg = gr.pmt.cdr(msg_pmt)
+ if meta=="freq":
+ freq = gr.pmt.to_double(msg)
+ Qt.QCoreApplication.postEvent(self, CallEvent(self.set_freq, freq))
+
+ def event(self, event):
+ event.accept()
+ result = event.fn(*event.args, **event.kwargs)
+ return True
+
+
+class app_top_block(gr.top_block, Qt.QMainWindow):
+ def __init__(self, argv, title):
+ gr.top_block.__init__(self, title)
+ Qt.QMainWindow.__init__(self)
+ self.setWindowTitle(title)
parser = OptionParser(option_class=eng_option)
parser.add_option("-a", "--args", type="string", default="",
@@ -89,6 +115,8 @@ class app_top_block(stdgui2.std_top_block, pubsub):
help="Enable fosphor display")
parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
help="Enable oscilloscope display")
+ parser.add_option("-Q", "--qtgui", action="store_true", default=False,
+ help="Enable QTgui 'all-in-one' display")
parser.add_option("", "--avg-alpha", type="eng_float", default=1e-1,
help="Set fftsink averaging factor, default=[%default]")
parser.add_option("", "--averaging", action="store_true", default=False,
@@ -112,16 +140,20 @@ class app_top_block(stdgui2.std_top_block, pubsub):
self._verbose = options.verbose
- self.src = osmosdr.source(options.args)
+ try:
+ self.src = osmosdr.source(options.args)
+ except RuntimeError:
+ print("Couldn't instanciate source (no device present?).", file=sys.stderr)
+ sys.exit(1)
try:
self.src.get_sample_rates().start()
except RuntimeError:
- print "Source has no sample rates (wrong device arguments?)."
+ print("Source has no sample rates (wrong device arguments?).", file=sys.stderr)
sys.exit(1)
# Set the antenna
- if(options.antenna):
+ if options.antenna:
self.src.set_antenna(options.antenna)
# Set the clock source:
@@ -140,7 +172,6 @@ class app_top_block(stdgui2.std_top_block, pubsub):
options.gain = float(r.start()+r.stop())/2
except RuntimeError:
options.gain = 0
- pass
else:
options.gain = gain
@@ -149,19 +180,28 @@ class app_top_block(stdgui2.std_top_block, pubsub):
if self._verbose:
gain_names = self.src.get_gain_names()
for name in gain_names:
- range = self.src.get_gain_range(name)
- print "%s gain range: start %d stop %d step %d" % (name, range.start(), range.stop(), range.step())
+ rg = self.src.get_gain_range(name)
+ print("%s gain range: start %g stop %g step %g" % (name, rg.start(), rg.stop(), rg.step()))
if options.gains:
for tuple in options.gains.split(","):
name, gain = tuple.split(":")
gain = int(gain)
- print "Setting gain %s to %d." % (name, gain)
+ print("Setting gain %s to %g." % (name, gain))
self.src.set_gain(gain, name)
if self._verbose:
rates = self.src.get_sample_rates()
- print 'Supported sample rates %d-%d step %d.' % (rates.start(), rates.stop(), rates.step())
+ print('Supported sample rates %.10g-%.10g step %.10g.' % (rates.start(), rates.stop(), rates.step()))
+
+ self.bandwidth_ok = True
+ try:
+ rg = self.src.get_bandwidth_range()
+ range_start = rg.start()
+ if self._verbose:
+ print('Supported bandwidth rates %.10g-%.10g step %.10g.' % (rg.start(), rg.stop(), rg.step()))
+ except RuntimeError as ex:
+ self.bandwidth_ok = False
if options.center_freq is None:
freq = self.src.get_center_freq()
@@ -171,93 +211,102 @@ class app_top_block(stdgui2.std_top_block, pubsub):
# if no freq was specified, use the mid-point in Hz
r = self.src.get_freq_range()
options.center_freq = float(r.start()+r.stop())/2
+ if self._verbose:
+ print("Using auto-calculated mid-point frequency")
input_rate = self.src.set_sample_rate(options.samp_rate)
self.src.set_bandwidth(input_rate)
- self.publish(SAMP_RANGE_KEY, self.src.get_sample_rates)
- self.publish(FREQ_RANGE_KEY, self.src.get_freq_range)
-
- for name in self.get_gain_names():
- self.publish(GAIN_RANGE_KEY(name), (lambda self=self,name=name: self.src.get_gain_range(name)))
-
- self.publish(BWIDTH_RANGE_KEY, self.src.get_bandwidth_range)
+ if self._verbose:
+ ranges = self.src.get_freq_range()
+ print("Supported frequencies %s-%s"%(eng_notation.num_to_str(ranges.start()), eng_notation.num_to_str(ranges.stop())))
- for name in self.get_gain_names():
- self.publish(GAIN_KEY(name), (lambda self=self,name=name: self.src.get_gain(name)))
- self.publish(BWIDTH_KEY, self.src.get_bandwidth)
+ for name in self.src.get_gain_names():
+ print("GAIN(%s): %g"%(name, self.src.get_gain(name)))
# initialize values from options
- self[SAMP_RANGE_KEY] = self.src.get_sample_rates()
- self[SAMP_RATE_KEY] = options.samp_rate
- self[CENTER_FREQ_KEY] = options.center_freq
- self[FREQ_CORR_KEY] = options.freq_corr
- self['record'] = options.record
+ if options.freq_corr is not None:
+ self.set_freq_corr(options.freq_corr)
self.dc_offset_mode = options.dc_offset_mode
self.iq_balance_mode = options.iq_balance_mode
# initialize reasonable defaults for DC / IQ correction
- self['dc_offset_real'] = 0
- self['dc_offset_imag'] = 0
- self['iq_balance_mag'] = 0
- self['iq_balance_pha'] = 0
-
- #subscribe set methods
- self.subscribe(SAMP_RATE_KEY, self.set_sample_rate)
+ self.dc_offset_real = 0
+ self.dc_offset_imag = 0
+ self.iq_balance_mag = 0
+ self.iq_balance_pha = 0
- for name in self.get_gain_names():
- self.subscribe(GAIN_KEY(name), (lambda gain,self=self,name=name: self.set_named_gain(gain, name)))
-
- self.subscribe(BWIDTH_KEY, self.set_bandwidth)
- self.subscribe(CENTER_FREQ_KEY, self.set_freq)
- self.subscribe(FREQ_CORR_KEY, self.set_freq_corr)
-
- self.subscribe('dc_offset_real', self.set_dc_offset)
- self.subscribe('dc_offset_imag', self.set_dc_offset)
- self.subscribe('iq_balance_mag', self.set_iq_balance)
- self.subscribe('iq_balance_pha', self.set_iq_balance)
-
- #force update on pubsub keys
- #for key in (SAMP_RATE_KEY, BWIDTH_KEY, CENTER_FREQ_KEY, FREQ_CORR_KEY):
- #print key, "=", self[key]
- #self[key] = self[key]
+ # see https://github.com/gnuradio/gnuradio/issues/5175 - 3.9 has a backport of pyqwidget, but 3.10 does not.
+ check_qwidget = lambda : self.scope.pyqwidget() if "pyqwidget" in dir(self.scope) else self.scope.qwidget()
if options.fosphor:
from gnuradio import fosphor
- self.scope = fosphor.wx_sink_c(panel, size=(800,300))
- self.scope.set_sample_rate(input_rate)
- self.frame.SetMinSize((800,600))
+ self.scope = fosphor.qt_sink_c()
+ self.scope.set_frequency_range(0, input_rate)
+ self.scope_win = sip.wrapinstance(check_qwidget(), Qt.QWidget)
+ self.scope_win.setMinimumSize(800, 300)
elif options.waterfall:
- self.scope = waterfallsink2.waterfall_sink_c (panel,
- fft_size=options.fft_size,
- sample_rate=input_rate,
- ref_scale=options.ref_scale,
- ref_level=20.0,
- y_divs = 12)
-
- self.scope.set_callback(self.wxsink_callback)
- self.frame.SetMinSize((800, 420))
+ self.scope = qtgui.waterfall_sink_c(
+ options.fft_size,
+ wintype=window.WIN_BLACKMAN_hARRIS,
+ fc=0,
+ bw=input_rate,
+ name="",
+ nconnections=1
+ )
+ self.scope.enable_grid(False)
+ self.scope.enable_axis_labels(True)
+ self.scope.set_intensity_range(-100, 20)
+ self.scope_win = sip.wrapinstance(check_qwidget(), Qt.QWidget)
+ self.scope_win.setMinimumSize(800, 420)
+
elif options.oscilloscope:
- self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
- self.frame.SetMinSize((800, 600))
+ self.scope = qtgui.time_sink_c(
+ options.fft_size,
+ samp_rate=input_rate,
+ name="",
+ nconnections=1
+ )
+ self.scope_win = sip.wrapinstance(check_qwidget(), Qt.QWidget)
+ self.scope_win.setMinimumSize(800, 600)
+
+ elif options.qtgui:
+ self.scope = qtgui.sink_c(
+ options.fft_size,
+ wintype=window.WIN_BLACKMAN_hARRIS,
+ fc=0,
+ bw=input_rate,
+ name="",
+ plotfreq=True,
+ plotwaterfall=True,
+ plottime=True,
+ plotconst=True
+ )
+ self.scope_win = sip.wrapinstance(check_qwidget(), Qt.QWidget)
+ self.scope.set_update_time(1.0/10)
+ self.scope_win.setMinimumSize(800, 600)
+
else:
- self.scope = fftsink2.fft_sink_c (panel,
- fft_size=options.fft_size,
- sample_rate=input_rate,
- ref_scale=options.ref_scale,
- ref_level=20.0,
- y_divs = 12,
- average=options.averaging,
- peak_hold=options.peak_hold,
- avg_alpha=options.avg_alpha,
- fft_rate=options.fft_rate)
-
- self.scope.set_callback(self.wxsink_callback)
- self.frame.SetMinSize((800, 420))
-
- self.connect(self.src, self.scope)
+ self.scope = qtgui.freq_sink_c(
+ fftsize=options.fft_size,
+ wintype=window.WIN_BLACKMAN_hARRIS,
+ fc=0,
+ bw=input_rate,
+ name="",
+ nconnections=1
+ )
+ self.scope_win = sip.wrapinstance(check_qwidget(), Qt.QWidget)
+ self.scope.disable_legend()
+ self.scope_win.setMinimumSize(800, 420)
+
+ self.connect((self.src, 0), (self.scope, 0))
+ try:
+ self.freq = freq_recv(self.set_freq)
+ self.msg_connect((self.scope, 'freq'), (self.freq, 'msg'))
+ except RuntimeError:
+ self.freq = None
self.file_sink = blocks.file_sink(gr.sizeof_gr_complex, "/dev/null", False)
self.file_sink.set_unbuffered(False)
@@ -265,586 +314,404 @@ class app_top_block(stdgui2.std_top_block, pubsub):
# lock/connect/unlock at record button event did not work, so we leave it connected at all times
self.connect(self.src, self.file_sink)
- self._build_gui(vbox)
-
- if self.dc_offset_mode != None:
- self.set_dc_offset_mode(self.dc_offset_mode)
-
- if self.iq_balance_mode != None:
- self.set_iq_balance_mode(self.iq_balance_mode)
+ self._build_gui()
# set initial values
- if not(self.set_freq(options.center_freq)):
+ if not self.set_freq(options.center_freq):
self._set_status_msg("Failed to set initial frequency")
+ if options.record is not None:
+ self._fre.insert(options.record)
def record_to_filename(self):
- s = self['record']
+ s = self._fre.text()
s = s.replace('%S', '%e' % self.src.get_sample_rate())
s = s.replace('%F', '%e' % self.src.get_center_freq())
s = s.replace('%T', datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
return s
- def wxsink_callback(self, x, y):
- self.set_freq_from_callback(x)
+ def _set_status_msg(self, msg, timeout=0):
+ self.status.showMessage(msg, timeout)
- def _set_status_msg(self, msg):
- self.frame.GetStatusBar().SetStatusText(msg, 0)
-
- def _build_gui(self, vbox):
-
- if hasattr(self.scope, 'win'):
- vbox.Add(self.scope.win, 1, wx.EXPAND)
- vbox.AddSpacer(3)
+ def _shrink(self, widget):
+ """Try to shrink RangeWidget by removing unnecessary margins"""
+ try:
+ widget.layout().setContentsMargins(0, 0, 0, 0)
+ widget.children()[0].layout().setContentsMargins(0, 0, 0, 0)
+ except:
+ pass
- # add control area at the bottom
- self.myform = myform = form.form()
+ def _add_section(self, text, layout):
+ """Add a section header to the GUI"""
+ frame = Qt.QWidget()
+ frame_layout = Qt.QHBoxLayout()
+ frame_layout.setContentsMargins(0, 0, 0, 0)
+ frame.setLayout(frame_layout)
+
+ wid = Qt.QLabel()
+ wid.setText(text)
+ wid.setStyleSheet("font-weight: bold;")
+ frame_layout.addWidget(wid)
+ wid = Qt.QFrame()
+ wid.setFrameShape(Qt.QFrame.HLine)
+ frame_layout.addWidget(wid)
+ frame_layout.setStretchFactor(wid, 1)
+
+ layout.addWidget(frame)
+
+ def _chooser(self, names, callback, default=0):
+ """A simple radio-button chooser"""
+ buttons = Qt.QWidget()
+ blayout = Qt.QHBoxLayout()
+ bgroup = Qt.QButtonGroup()
+ buttons.setObjectName("foo")
+ buttons.setStyleSheet("QWidget#foo {border: 1px outset grey;}")
+ buttons.setLayout(blayout)
+ chooser = []
+ for (num, txt) in enumerate(names):
+ rb = Qt.QRadioButton(txt)
+ rb.clicked.connect(partial(callback, num))
+ chooser.append(rb)
+ bgroup.addButton(rb,num)
+ blayout.addWidget(rb)
+ if num == default:
+ rb.setChecked(True)
+ return buttons
+
+ def _build_gui(self):
+
+ self.top_widget = Qt.QWidget()
+
+ self.top_layout = Qt.QVBoxLayout(self.top_widget)
+ self.top_layout.addWidget(self.scope_win)
+
+ self.setCentralWidget(self.top_widget)
+
+ self.status = Qt.QStatusBar()
+ self.setStatusBar(self.status)
+ self.status.setStyleSheet("QStatusBar{border-top: 1px outset grey;}")
+
+ if hasattr(RangeWidget, 'EngSlider'):
+ eng_widget="eng_slider"
+ else:
+ eng_widget="counter_slider"
##################################################
# Frequency controls
##################################################
- fc_vbox = forms.static_box_sizer(parent=self.panel,
- label="Center Frequency",
- orient=wx.VERTICAL,
- bold=True)
- fc_vbox.AddSpacer(3)
- # First row of frequency controls (center frequency)
- freq_hbox = wx.BoxSizer(wx.HORIZONTAL)
- fc_vbox.Add(freq_hbox, 0, wx.EXPAND)
- fc_vbox.AddSpacer(5)
- # Second row of frequency controls (freq. correction)
- corr_hbox = wx.BoxSizer(wx.HORIZONTAL)
- fc_vbox.Add(corr_hbox, 0, wx.EXPAND)
- fc_vbox.AddSpacer(3)
-
- # Add frequency controls to top window sizer
- vbox.Add(fc_vbox, 0, wx.EXPAND)
- vbox.AddSpacer(5)
-
- freq_hbox.AddSpacer(3)
- forms.text_box(
- parent=self.panel, sizer=freq_hbox,
- label='Center Frequency (Hz)',
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key=CENTER_FREQ_KEY,
- )
- freq_hbox.AddSpacer(5)
-
- try: # range.start() == range.stop() in file= mode
-
- forms.slider(
- parent=self.panel, sizer=freq_hbox,
- proportion=3,
- ps=self,
- key=CENTER_FREQ_KEY,
- minimum=self[FREQ_RANGE_KEY].start(),
- maximum=self[FREQ_RANGE_KEY].stop(),
- num_steps=1000,
- )
- freq_hbox.AddSpacer(3)
+ self._add_section("Frequency", self.top_layout)
- except AssertionError:
- pass
+ r = self.src.get_freq_range()
+ self._fr = Range(r.start(), r.stop(), (r.start()+r.stop())/100, self.src.get_center_freq(), 200)
+ self._fw = RangeWidget(self._fr, self.set_freq, 'Center Frequency (Hz)', eng_widget, float)
+ self._shrink(self._fw)
+ self.top_layout.addWidget(self._fw)
- if self[FREQ_CORR_KEY] != None: # show frequency correction scrollbar
-
- corr_hbox.AddSpacer(3)
- forms.text_box(
- parent=self.panel, sizer=corr_hbox,
- label='Freq. Correction (ppm)',
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key=FREQ_CORR_KEY,
- )
- corr_hbox.AddSpacer(5)
-
- forms.slider(
- parent=self.panel, sizer=corr_hbox,
- proportion=3,
- ps=self,
- key=FREQ_CORR_KEY,
- minimum=-100,
- maximum=+100,
- num_steps=2010,
- step_size=0.1,
- )
- corr_hbox.AddSpacer(3)
+ if hasattr(self, 'ppm') and self.ppm is not None:
+ self._fcr = Range(-100, 100, 0.1, self.src.get_freq_corr(), 200)
+ self._fcw = RangeWidget(self._fcr, self.set_freq_corr, 'Freq. Correction (ppm)', "counter_slider", float)
+ self._shrink(self._fcw)
+ self.top_layout.addWidget(self._fcw)
##################################################
# Gain controls
##################################################
- gc_vbox = forms.static_box_sizer(parent=self.panel,
- label="Gain Settings",
- orient=wx.VERTICAL,
- bold=True)
- gc_vbox.AddSpacer(3)
-
- # Add gain controls to top window sizer
- vbox.Add(gc_vbox, 0, wx.EXPAND)
- vbox.AddSpacer(5)
-
- for gain_name in self.get_gain_names():
- range = self[GAIN_RANGE_KEY(gain_name)]
- gain = self[GAIN_KEY(gain_name)]
-
- #print gain_name, gain, range.to_pp_string()
- if range.start() < range.stop():
- gain_hbox = wx.BoxSizer(wx.HORIZONTAL)
- gc_vbox.Add(gain_hbox, 0, wx.EXPAND)
- gc_vbox.AddSpacer(3)
-
- gain_hbox.AddSpacer(3)
- forms.text_box(
- parent=self.panel, sizer=gain_hbox,
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key=GAIN_KEY(gain_name),
- label=gain_name + " Gain (dB)",
- )
- gain_hbox.AddSpacer(5)
- forms.slider(
- parent=self.panel, sizer=gain_hbox,
- proportion=3,
- ps=self,
- key=GAIN_KEY(gain_name),
- minimum=range.start(),
- maximum=range.stop(),
- step_size=range.step() or (range.stop() - range.start())/10,
- )
- gain_hbox.AddSpacer(3)
+ self._add_section("Gains", self.top_layout)
+
+ self._gr={}
+ self._gw={}
+ for gain_name in self.src.get_gain_names():
+ rg = self.src.get_gain_range(gain_name)
+ self._gr[gain_name] = Range(rg.start(), rg.stop(), rg.step(), self.src.get_gain(gain_name), 100)
+ self._gw[gain_name] = RangeWidget(self._gr[gain_name], partial(self.set_named_gain,name=gain_name), '%s Gain (dB):'%gain_name, "counter_slider", float)
+ self._shrink(self._gw[gain_name])
+ self._gw[gain_name].d_widget.counter.setDecimals(2)
+ self.top_layout.addWidget(self._gw[gain_name])
##################################################
# Bandwidth controls
##################################################
- try:
-
- bw_range = self[BWIDTH_RANGE_KEY]
- #print bw_range.to_pp_string()
- if bw_range.start() < bw_range.stop():
- bwidth_vbox = forms.static_box_sizer(parent=self.panel,
- label="Bandwidth",
- orient=wx.VERTICAL,
- bold=True)
- bwidth_vbox.AddSpacer(3)
- bwidth_hbox = wx.BoxSizer(wx.HORIZONTAL)
- bwidth_vbox.Add(bwidth_hbox, 0, wx.EXPAND)
- bwidth_vbox.AddSpacer(3)
-
- vbox.Add(bwidth_vbox, 0, wx.EXPAND)
- vbox.AddSpacer(5)
-
- bwidth_hbox.AddSpacer(3)
- forms.text_box(
- parent=self.panel, sizer=bwidth_hbox,
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key=BWIDTH_KEY,
- label="Bandwidth (Hz)",
- )
- bwidth_hbox.AddSpacer(5)
- forms.slider(
- parent=self.panel, sizer=bwidth_hbox,
- proportion=3,
- ps=self,
- key=BWIDTH_KEY,
- minimum=bw_range.start(),
- maximum=bw_range.stop(),
- step_size=bw_range.step() or (bw_range.stop() - bw_range.start())/100,
- )
- bwidth_hbox.AddSpacer(3)
-
- except RuntimeError:
- pass
+ if self.bandwidth_ok:
+ self._add_section("Bandwidth", self.top_layout)
+ r = self.src.get_bandwidth_range()
+ self._bwr = Range(r.start(), r.stop(), r.step() or (r.stop() - r.start())/100, self.src.get_bandwidth(), 100)
+ self._bww = RangeWidget(self._bwr, self.set_bandwidth, 'Bandwidth (Hz):', eng_widget, float)
+ self._shrink(self._bww)
+ self.top_layout.addWidget(self._bww)
##################################################
# Sample rate controls
##################################################
- sr_vbox = forms.static_box_sizer(parent=self.panel,
- label="Sample Rate",
- orient=wx.VERTICAL,
- bold=True)
- sr_vbox.AddSpacer(3)
- # First row of sample rate controls
- sr_hbox = wx.BoxSizer(wx.HORIZONTAL)
- sr_vbox.Add(sr_hbox, 0, wx.EXPAND)
- sr_vbox.AddSpacer(5)
-
- # Add sample rate controls to top window sizer
- vbox.Add(sr_vbox, 0, wx.EXPAND)
- vbox.AddSpacer(5)
-
- sr_hbox.AddSpacer(3)
- self.sample_rate_text = forms.text_box(
- parent=self.panel, sizer=sr_hbox,
- label='Sample Rate (Hz)',
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key=SAMP_RATE_KEY,
- )
- sr_hbox.AddSpacer(5)
-
- #forms.slider(
- # parent=self.panel, sizer=sr_hbox,
- # proportion=3,
- # ps=self,
- # key=SAMP_RATE_KEY,
- # minimum=self[SAMP_RANGE_KEY].start(),
- # maximum=self[SAMP_RANGE_KEY].stop(),
- # step_size=self[SAMP_RANGE_KEY].step(),
- #)
- #sr_hbox.AddSpacer(3)
+ self._add_section("Sample Rate", self.top_layout)
+ r = self.src.get_sample_rates()
+ self._srr = Range(r.start(), r.stop(), r.step() or (r.stop() - r.start())/100, self.src.get_sample_rate(), 100)
+ self._srw = RangeWidget(self._srr, self.set_sample_rate, 'Sample Rate (Hz)', eng_widget, float)
+ self._shrink(self._srw)
+ self.top_layout.addWidget(self._srw)
##################################################
# File recording controls
##################################################
- rec_vbox = forms.static_box_sizer(parent=self.panel,
- label="File recording",
- orient=wx.VERTICAL,
- bold=True)
- rec_vbox.AddSpacer(3)
- # First row of sample rate controls
- rec_hbox = wx.BoxSizer(wx.HORIZONTAL)
- rec_vbox.Add(rec_hbox, 0, wx.EXPAND)
- rec_vbox.AddSpacer(5)
-
- # Add sample rate controls to top window sizer
- vbox.Add(rec_vbox, 0, wx.EXPAND)
- vbox.AddSpacer(5)
-
- rec_hbox.AddSpacer(3)
- self.record_text = forms.text_box(
- parent=self.panel, sizer=rec_hbox,
- label='File Name',
- proportion=1,
- ps=self,
- key='record',
- converter=forms.str_converter(),
- )
- rec_hbox.AddSpacer(5)
-
- def record_callback(value):
- if value:
- self.sample_rate_text.Disable()
- self.record_text.Disable()
+ self._add_section("File recording", self.top_layout)
+
+ wid = Qt.QWidget()
+
+ layout = Qt.QHBoxLayout()
+ layout.setContentsMargins(0, 0, 0, 0)
+
+ self._frl = Qt.QLabel('File Name')
+ layout.addWidget(self._frl)
+
+ self._fre = Qt.QLineEdit()
+ layout.addWidget(self._fre)
+
+ self._frb = Qt.QPushButton('REC')
+ layout.addWidget(self._frb)
+
+ wid.setLayout(layout)
+ self.top_layout.addWidget(wid)
+
+ self.recording = 0
+ def record_callback():
+ self.recording = 1-self.recording
+ if self.recording:
+ self._srw.setDisabled(True)
+ self._fre.setDisabled(True)
+ self._frb.setText('STOP')
self.rec_file_name = self.record_to_filename()
- print "Recording samples to ", self.rec_file_name
+ print("Recording samples to ", self.rec_file_name)
self.file_sink.open(self.rec_file_name);
else:
- self.sample_rate_text.Enable()
- self.record_text.Enable()
+ self._srw.setDisabled(False)
+ self._fre.setDisabled(False)
+ self._frb.setText('REC')
self.file_sink.close()
- print "Finished recording to", self.rec_file_name
+ print("Finished recording to", self.rec_file_name)
- forms.toggle_button(
- sizer=rec_hbox,
- parent=self.panel,
- false_label='REC',
- true_label='STOP',
- value=False,
- callback=record_callback,
- )
+ self._fre.returnPressed.connect(record_callback)
+ self._frb.clicked.connect(record_callback)
##################################################
# DC Offset controls
##################################################
if self.dc_offset_mode != None:
+ self._add_section("DC Offset Correction", self.top_layout)
- dc_offset_vbox = forms.static_box_sizer(parent=self.panel,
- label="DC Offset Correction",
- orient=wx.VERTICAL,
- bold=True)
- dc_offset_vbox.AddSpacer(3)
- # First row of sample rate controls
- dc_offset_hbox = wx.BoxSizer(wx.HORIZONTAL)
- dc_offset_vbox.Add(dc_offset_hbox, 0, wx.EXPAND)
- dc_offset_vbox.AddSpacer(3)
-
- # Add frequency controls to top window sizer
- vbox.Add(dc_offset_vbox, 0, wx.EXPAND)
- vbox.AddSpacer(3)
-
- self.dc_offset_mode_chooser = forms.radio_buttons(
- parent=self.panel,
- value=self.dc_offset_mode,
- callback=self.set_dc_offset_mode,
- label='',
- choices=[0, 1, 2],
- labels=["Off", "Manual", "Auto"],
- style=wx.RA_HORIZONTAL,
- )
- dc_offset_hbox.Add(self.dc_offset_mode_chooser)
- dc_offset_hbox.AddSpacer(3)
-
- dc_offset_hbox.AddSpacer(3)
- self.dc_offset_real_text = forms.text_box(
- parent=self.panel, sizer=dc_offset_hbox,
- label='Real',
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key='dc_offset_real',
- )
- dc_offset_hbox.AddSpacer(3)
-
- self.dc_offset_real_slider = forms.slider(
- parent=self.panel, sizer=dc_offset_hbox,
- proportion=3,
- minimum=-1,
- maximum=+1,
- step_size=0.001,
- ps=self,
- key='dc_offset_real',
- )
- dc_offset_hbox.AddSpacer(3)
-
- dc_offset_hbox.AddSpacer(3)
- self.dc_offset_imag_text = forms.text_box(
- parent=self.panel, sizer=dc_offset_hbox,
- label='Imag',
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key='dc_offset_imag',
- )
- dc_offset_hbox.AddSpacer(3)
-
- self.dc_offset_imag_slider = forms.slider(
- parent=self.panel, sizer=dc_offset_hbox,
- proportion=3,
- minimum=-1,
- maximum=+1,
- step_size=0.001,
- ps=self,
- key='dc_offset_imag',
- )
- dc_offset_hbox.AddSpacer(3)
+ wid = Qt.QWidget()
+
+ layout = Qt.QHBoxLayout()
+ layout.setContentsMargins(0, 0, 0, 0)
+
+ self._dcb = self._chooser(["Off", "Manual", "Auto"], self.set_dc_offset_mode, self.dc_offset_mode)
+ layout.addWidget(self._dcb)
+
+ self._dcrr = Range(-1, +1, 0.001, 0, 20)
+ self._dcrw = RangeWidget(self._dcrr, self.set_dc_offset_real, 'Real', "counter_slider", float)
+ self._shrink(self._dcrw)
+ layout.addWidget(self._dcrw)
+
+ self._dcir = Range(-1, +1, 0.001, 0, 20)
+ self._dciw = RangeWidget(self._dcrr, self.set_dc_offset_imag, 'Imag', "counter_slider", float)
+ self._shrink(self._dciw)
+ layout.addWidget(self._dciw)
+
+ wid.setLayout(layout)
+ self.top_layout.addWidget(wid)
##################################################
# IQ Imbalance controls
##################################################
if self.iq_balance_mode != None:
+ self._add_section("IQ Imbalance Correction", self.top_layout)
- iq_balance_vbox = forms.static_box_sizer(parent=self.panel,
- label="IQ Imbalance Correction",
- orient=wx.VERTICAL,
- bold=True)
- iq_balance_vbox.AddSpacer(3)
- # First row of sample rate controls
- iq_balance_hbox = wx.BoxSizer(wx.HORIZONTAL)
- iq_balance_vbox.Add(iq_balance_hbox, 0, wx.EXPAND)
- iq_balance_vbox.AddSpacer(3)
-
- # Add frequency controls to top window sizer
- vbox.Add(iq_balance_vbox, 0, wx.EXPAND)
- vbox.AddSpacer(3)
-
- self.iq_balance_mode_chooser = forms.radio_buttons(
- parent=self.panel,
- value=self.iq_balance_mode,
- callback=self.set_iq_balance_mode,
- label='',
- choices=[0, 1, 2],
- labels=["Off", "Manual", "Auto"],
- style=wx.RA_HORIZONTAL,
- )
- iq_balance_hbox.Add(self.iq_balance_mode_chooser)
- iq_balance_hbox.AddSpacer(3)
-
- iq_balance_hbox.AddSpacer(3)
- self.iq_balance_mag_text = forms.text_box(
- parent=self.panel, sizer=iq_balance_hbox,
- label='Mag',
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key='iq_balance_mag',
- )
- iq_balance_hbox.AddSpacer(3)
-
- self.iq_balance_mag_slider = forms.slider(
- parent=self.panel, sizer=iq_balance_hbox,
- proportion=3,
- minimum=-1,
- maximum=+1,
- step_size=0.001,
- ps=self,
- key='iq_balance_mag',
- )
- iq_balance_hbox.AddSpacer(3)
-
- iq_balance_hbox.AddSpacer(3)
- self.iq_balance_pha_text = forms.text_box(
- parent=self.panel, sizer=iq_balance_hbox,
- label='Phase',
- proportion=1,
- converter=forms.float_converter(),
- ps=self,
- key='iq_balance_pha',
- )
- iq_balance_hbox.AddSpacer(3)
-
- self.iq_balance_pha_slider = forms.slider(
- parent=self.panel, sizer=iq_balance_hbox,
- proportion=3,
- minimum=-1,
- maximum=+1,
- step_size=0.001,
- ps=self,
- key='iq_balance_pha',
- )
- iq_balance_hbox.AddSpacer(3)
+ wid = Qt.QWidget()
+
+ layout = Qt.QHBoxLayout()
+ layout.setContentsMargins(0, 0, 0, 0)
+
+ self._iqb = self._chooser(["Off", "Manual", "Auto"], self.set_dc_offset_mode, self.iq_balance_mode)
+ layout.addWidget(self._iqb)
+
+ self._iqmr = Range(-1, +1, 0.001, 0, 20)
+ self._iqmw = RangeWidget(self._iqmr, self.set_iq_balance_mag, 'Mag', "counter_slider", float)
+ self._shrink(self._iqmw)
+ layout.addWidget(self._iqmw)
+
+ self._iqpr = Range(-1, +1, 0.001, 0, 20)
+ self._iqpw = RangeWidget(self._iqpr, self.set_iq_balance_pha, 'Pha', "counter_slider", float)
+ self._shrink(self._iqpw)
+ layout.addWidget(self._iqpw)
+
+ wid.setLayout(layout)
+ self.top_layout.addWidget(wid)
def set_dc_offset_mode(self, dc_offset_mode):
if dc_offset_mode == 1:
- self.dc_offset_real_text.Enable()
- self.dc_offset_real_slider.Enable()
- self.dc_offset_imag_text.Enable()
- self.dc_offset_imag_slider.Enable()
+ self._dcrw.setDisabled(False)
+ self._dciw.setDisabled(False)
- self.set_dc_offset(0)
+ self.set_dc_offset()
else:
- self.dc_offset_real_text.Disable()
- self.dc_offset_real_slider.Disable()
- self.dc_offset_imag_text.Disable()
- self.dc_offset_imag_slider.Disable()
+ self._dcrw.setDisabled(True)
+ self._dciw.setDisabled(True)
self.dc_offset_mode = dc_offset_mode
self.src.set_dc_offset_mode(dc_offset_mode)
- self.dc_offset_mode_chooser.set_value(self.dc_offset_mode)
- def set_dc_offset(self, value):
- correction = complex( self['dc_offset_real'], self['dc_offset_imag'] )
+ def set_dc_offset_real(self, value):
+ self.dc_offset_real = value
+ self.set_dc_offset()
+
+ def set_dc_offset_imag(self, value):
+ self.dc_offset_imag = value
+ self.set_dc_offset()
+
+ def set_dc_offset(self):
+ correction = complex(self.dc_offset_real, self.dc_offset_imag)
try:
- self.src.set_dc_offset( correction )
+ self.src.set_dc_offset(correction)
if self._verbose:
- print "Set DC offset to", correction
+ print("Set DC offset to", correction)
except RuntimeError as ex:
- print ex
+ print(ex)
def set_iq_balance_mode(self, iq_balance_mode):
if iq_balance_mode == 1:
- self.iq_balance_mag_text.Enable()
- self.iq_balance_mag_slider.Enable()
- self.iq_balance_pha_text.Enable()
- self.iq_balance_pha_slider.Enable()
+ self._iqpw.setDisabled(False)
+ self._iqmw.setDisabled(False)
- self.set_iq_balance(0)
+ self.set_iq_balance()
else:
- self.iq_balance_mag_text.Disable()
- self.iq_balance_mag_slider.Disable()
- self.iq_balance_pha_text.Disable()
- self.iq_balance_pha_slider.Disable()
+ self._iqpw.setDisabled(True)
+ self._iqmw.setDisabled(True)
self.iq_balance_mode = iq_balance_mode
self.src.set_iq_balance_mode(iq_balance_mode)
- self.iq_balance_mode_chooser.set_value(self.iq_balance_mode)
- def set_iq_balance(self, value):
- correction = complex( self['iq_balance_mag'], self['iq_balance_pha'] )
+ def set_iq_balance_mag(self, value):
+ self.iq_balance_mag = value
+ self.set_iq_balance()
+
+ def set_iq_balance_pha(self, value):
+ self.iq_balance_pha = value
+ self.set_iq_balance()
+
+ def set_iq_balance(self):
+ correction = complex(self.iq_balance_mag, self.iq_balance_pha)
try:
- self.src.set_iq_balance( correction )
+ self.src.set_iq_balance(correction)
if self._verbose:
- print "Set IQ balance to", correction
+ print("Set IQ balance to", correction)
except RuntimeError as ex:
- print ex
+ print(ex)
def set_sample_rate(self, samp_rate):
samp_rate = self.src.set_sample_rate(samp_rate)
+ if hasattr(self.scope, 'set_frequency_range'):
+ self.scope.set_frequency_range(self.src.get_center_freq(), samp_rate)
if hasattr(self.scope, 'set_sample_rate'):
self.scope.set_sample_rate(samp_rate)
if self._verbose:
- print "Set sample rate to:", samp_rate
+ print("Set sample rate to:", samp_rate)
try:
- self[BWIDTH_KEY] = self.set_bandwidth(samp_rate)
- except RuntimeError:
+ if hasattr(self._bww.d_widget, 'setValue'):
+ self._bww.d_widget.setValue(samp_rate)
+ else:
+ self._bww.d_widget.counter.setValue(samp_rate)
+ except (RuntimeError, AttributeError):
pass
return samp_rate
- def get_gain_names(self):
- return self.src.get_gain_names()
-
def set_named_gain(self, gain, name):
- if gain is None:
- g = self[GAIN_RANGE_KEY(name)]
- gain = float(g.start()+g.stop())/2
- if self._verbose:
- print "Using auto-calculated mid-point gain"
- self[GAIN_KEY(name)] = gain
- return
+ if self._verbose:
+ print("Trying to set " + name + " gain to:", gain)
gain = self.src.set_gain(gain, name)
if self._verbose:
- print "Set " + name + " gain to:", gain
+ print("Set " + name + " gain to:", gain)
def set_bandwidth(self, bw):
- clipped_bw = self[BWIDTH_RANGE_KEY].clip(bw)
+ if self._verbose:
+ print("Trying to set bandwidth to:", bw)
+ clipped_bw = self.src.get_bandwidth_range().clip(bw)
+ if self._verbose:
+ print("Clipping bandwidth to:", clipped_bw)
if self.src.get_bandwidth() != clipped_bw:
bw = self.src.set_bandwidth(clipped_bw)
if self._verbose:
- print "Set bandwidth to:", bw
+ print("Set bandwidth to:", bw)
return bw
- def set_freq_from_callback(self, freq):
- freq = self.src.set_center_freq(freq)
- self[CENTER_FREQ_KEY] = freq;
-
def set_freq(self, freq):
- if freq is None:
- f = self[FREQ_RANGE_KEY]
- freq = float(f.start()+f.stop())/2.0
- if self._verbose:
- print "Using auto-calculated mid-point frequency"
- self[CENTER_FREQ_KEY] = freq
- return
freq = self.src.set_center_freq(freq)
+ if hasattr(self.scope, 'set_frequency_range'):
+ self.scope.set_frequency_range(freq, self.src.get_sample_rate())
if hasattr(self.scope, 'set_baseband_freq'):
self.scope.set_baseband_freq(freq)
+ try:
+ if hasattr(self._fw.d_widget, 'setValue'):
+ self._fw.d_widget.setValue(freq)
+ else:
+ self._fw.d_widget.counter.setValue(freq)
+ except (RuntimeError, AttributeError):
+ pass
+
if freq is not None:
if self._verbose:
- print "Set center frequency to", freq
+ print("Set center frequency to %.10g"%freq)
elif self._verbose:
- print "Failed to set freq."
+ print("Failed to set freq.")
return freq
def set_freq_corr(self, ppm):
- if ppm is None:
- ppm = 0.0
- if self._verbose:
- print "Using frequency corrrection of", ppm
- self[FREQ_CORR_KEY] = ppm
- return
-
- ppm = self.src.set_freq_corr(ppm)
+ self.ppm = self.src.set_freq_corr(ppm)
if self._verbose:
- print "Set frequency correction to:", ppm
+ print("Set frequency correction to:", self.ppm)
+
+
+def main():
+ qapp = Qt.QApplication(sys.argv)
+
+ tb = app_top_block(qapp.arguments(), "osmocom Spectrum Browser")
+ tb.start()
+ tb.show()
+
+ def sig_handler(sig=None, frame=None):
+ print("caught signal")
+ Qt.QApplication.quit()
+
+ signal.signal(signal.SIGINT, sig_handler)
+ signal.signal(signal.SIGTERM, sig_handler)
+
+ # this timer is necessary for signals (^C) to work
+ timer = Qt.QTimer()
+ timer.start(500)
+ timer.timeout.connect(lambda: None)
+
+ def quitting():
+ tb.stop()
+ tb.wait()
+ qapp.aboutToQuit.connect(quitting)
+ qapp.exec_()
-def main ():
- app = stdgui2.stdapp(app_top_block, "osmocom Spectrum Browser", nstatus=1)
- app.MainLoop()
if __name__ == '__main__':
- main ()
+ main()
diff --git a/apps/osmocom_siggen b/apps/osmocom_siggen
index bd92eac..b2f9411 100755
--- a/apps/osmocom_siggen
+++ b/apps/osmocom_siggen
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright 2009,2011,2012 Free Software Foundation, Inc.
#
@@ -483,7 +483,7 @@ def main():
app.MainLoop()
except RuntimeError, e:
- print e
+ print(e)
sys.exit(1)
# Make sure to create the top block (tb) within a function: That code
diff --git a/apps/osmocom_siggen_base.py b/apps/osmocom_siggen_base.py
index b6e9a0c..71b0747 100644
--- a/apps/osmocom_siggen_base.py
+++ b/apps/osmocom_siggen_base.py
@@ -46,7 +46,7 @@ from gnuradio import blocks
from gnuradio import filter
from gnuradio import analog
from gnuradio import digital
-from gnuradio import gr, gru, eng_notation
+from gnuradio import gr, eng_notation
from gnuradio.gr.pubsub import pubsub
from gnuradio.eng_option import eng_option
from optparse import OptionParser
@@ -109,9 +109,9 @@ class gsm_source_c(gr.hier_block2):
[0,0,0],
]
burst = sum(chunks,[])
- burst = sum(map(list, zip(burst, (1,) * len(burst))), [])
+ burst = sum(list(map(list, list(zip(burst, (1,) * len(burst))))), [])
burst += [1,0] * (l-148)
- return map(int, burst)
+ return list(map(int, burst))
def gen_gsm_frame(self):
return \
@@ -186,7 +186,7 @@ class top_block(gr.top_block, pubsub):
try:
self._sink.get_sample_rates().start()
except RuntimeError:
- print "Sink has no sample rates (wrong device arguments?)."
+ print("Sink has no sample rates (wrong device arguments?).")
sys.exit(1)
# Set the clock source:
@@ -202,60 +202,60 @@ class top_block(gr.top_block, pubsub):
if(options.gain):
gain = self._sink.set_gain(options.gain)
if self._verbose:
- print "Set gain to:", gain
+ print("Set gain to:", gain)
if self._verbose:
gain_names = self._sink.get_gain_names()
for name in gain_names:
range = self._sink.get_gain_range(name)
- print "%s gain range: start %d stop %d step %d" % (name, range.start(), range.stop(), range.step())
+ print("%s gain range: start %d stop %d step %d" % (name, range.start(), range.stop(), range.step()))
if options.gains:
for tuple in options.gains.split(","):
name, gain = tuple.split(":")
gain = int(gain)
- print "Setting gain %s to %d." % (name, gain)
+ print("Setting gain %s to %d." % (name, gain))
self._sink.set_gain(gain, name)
if self._verbose:
rates = self._sink.get_sample_rates()
- print 'Supported sample rates %d-%d step %d.' % (rates.start(), rates.stop(), rates.step())
+ print('Supported sample rates %d-%d step %d.' % (rates.start(), rates.stop(), rates.step()))
# Set the antenna
if self._verbose:
- print "setting antenna..."
+ print("setting antenna...")
if(options.antenna):
ant = self._sink.set_antenna(options.antenna, 0)
if self._verbose:
- print "Set antenna to:", ant
+ print("Set antenna to:", ant)
try:
self.publish(FREQ_RANGE_KEY, self._sink.get_freq_range)
except:
- print "Couldn't publish %s" % FREQ_RANGE_KEY
+ print("Couldn't publish %s" % FREQ_RANGE_KEY)
try:
for name in self.get_gain_names():
self.publish(GAIN_RANGE_KEY(name), (lambda self=self,name=name: self._sink.get_gain_range(name)))
except:
- print "Couldn't publish %s" % FREQ_RANGE_KEY
+ print("Couldn't publish %s" % FREQ_RANGE_KEY)
try:
self.publish(BWIDTH_RANGE_KEY, self._sink.get_bandwidth_range)
except:
if self._verbose:
- print "Couldn't publish %s" % BWIDTH_RANGE_KEY
+ print("Couldn't publish %s" % BWIDTH_RANGE_KEY)
try:
for name in self.get_gain_names():
self.publish(GAIN_KEY(name), (lambda self=self,name=name: self._sink.get_gain(name)))
except:
if self._verbose:
- print "Couldn't publish GAIN_KEYs"
+ print("Couldn't publish GAIN_KEYs")
try:
self.publish(BWIDTH_KEY, self._sink.get_bandwidth)
except:
if self._verbose:
- print "Couldn't publish %s" % BWIDTH_KEY
+ print("Couldn't publish %s" % BWIDTH_KEY)
def get_gain_names(self):
return self._sink.get_gain_names()
@@ -277,7 +277,7 @@ class top_block(gr.top_block, pubsub):
return True # Waveform not yet set
if self._verbose:
- print "Set sample rate to:", sr
+ print("Set sample rate to:", sr)
return True
@@ -286,27 +286,27 @@ class top_block(gr.top_block, pubsub):
g = self[GAIN_RANGE_KEY(name)]
gain = float(g.start()+g.stop())/2
if self._verbose:
- print "Using auto-calculated mid-point gain"
+ print("Using auto-calculated mid-point gain")
self[GAIN_KEY(name)] = gain
return
gain = self._sink.set_gain(gain, name)
if self._verbose:
- print "Set " + name + " gain to:", gain
+ print("Set " + name + " gain to:", gain)
def set_bandwidth(self, bw):
try:
clipped_bw = self[BWIDTH_RANGE_KEY].clip(bw)
except:
if self._verbose:
- print "couldn't clip bandwidth"
+ print("couldn't clip bandwidth")
return
if self._sink.get_bandwidth() != clipped_bw:
bw = self._sink.set_bandwidth(clipped_bw)
if self._verbose:
- print "Set bandwidth to:", bw
+ print("Set bandwidth to:", bw)
def set_dc_offset(self, value):
correction = complex( self[DC_OFFSET_REAL], self[DC_OFFSET_IMAG] )
@@ -315,9 +315,9 @@ class top_block(gr.top_block, pubsub):
self._sink.set_dc_offset( correction )
if self._verbose:
- print "Set DC offset to", correction
+ print("Set DC offset to", correction)
except RuntimeError as ex:
- print ex
+ print(ex)
def set_iq_balance(self, value):
correction = complex( self[IQ_BALANCE_MAG], self[IQ_BALANCE_PHA] )
@@ -326,16 +326,16 @@ class top_block(gr.top_block, pubsub):
self._sink.set_iq_balance( correction )
if self._verbose:
- print "Set IQ balance to", correction
+ print("Set IQ balance to", correction)
except RuntimeError as ex:
- print ex
+ print(ex)
def set_freq(self, freq):
if freq is None:
f = self[FREQ_RANGE_KEY]
freq = float(f.start()+f.stop())/2.0
if self._verbose:
- print "Using auto-calculated mid-point frequency"
+ print("Using auto-calculated mid-point frequency")
self[TX_FREQ_KEY] = freq
return
@@ -343,22 +343,22 @@ class top_block(gr.top_block, pubsub):
if freq is not None:
self._freq = freq
if self._verbose:
- print "Set center frequency to", freq
+ print("Set center frequency to", freq)
elif self._verbose:
- print "Failed to set freq."
+ print("Failed to set freq.")
return freq
def set_freq_corr(self, ppm):
if ppm is None:
ppm = 0.0
if self._verbose:
- print "Using frequency corrrection of", ppm
+ print("Using frequency corrrection of", ppm)
self[FREQ_CORR_KEY] = ppm
return
ppm = self._sink.set_freq_corr(ppm)
if self._verbose:
- print "Set frequency correction to:", ppm
+ print("Set frequency correction to:", ppm)
def set_waveform_freq(self, freq):
if self[TYPE_KEY] == analog.GR_SIN_WAVE:
@@ -433,24 +433,24 @@ class top_block(gr.top_block, pubsub):
self.unlock()
if self._verbose:
- print "Set baseband modulation to:", waveforms[type]
+ print("Set baseband modulation to:", waveforms[type])
if type == analog.GR_SIN_WAVE:
- print "Modulation frequency: %sHz" % (n2s(self[WAVEFORM_FREQ_KEY]),)
- print "Initial phase:", self[WAVEFORM_OFFSET_KEY]
+ print("Modulation frequency: %sHz" % (n2s(self[WAVEFORM_FREQ_KEY]),))
+ print("Initial phase:", self[WAVEFORM_OFFSET_KEY])
elif type == "2tone":
- print "Tone 1: %sHz" % (n2s(self[WAVEFORM_FREQ_KEY]),)
- print "Tone 2: %sHz" % (n2s(self[WAVEFORM2_FREQ_KEY]),)
+ print("Tone 1: %sHz" % (n2s(self[WAVEFORM_FREQ_KEY]),))
+ print("Tone 2: %sHz" % (n2s(self[WAVEFORM2_FREQ_KEY]),))
elif type == "sweep":
- print "Sweeping across %sHz to %sHz" % (n2s(-self[WAVEFORM_FREQ_KEY]/2.0),n2s(self[WAVEFORM_FREQ_KEY]/2.0))
- print "Sweep rate: %sHz" % (n2s(self[WAVEFORM2_FREQ_KEY]),)
+ print("Sweeping across %sHz to %sHz" % (n2s(-self[WAVEFORM_FREQ_KEY]/2.0),n2s(self[WAVEFORM_FREQ_KEY]/2.0)))
+ print("Sweep rate: %sHz" % (n2s(self[WAVEFORM2_FREQ_KEY]),))
elif type == "gsm":
- print "GSM Burst Sequence"
- print "TX amplitude:", self[AMPLITUDE_KEY]
+ print("GSM Burst Sequence")
+ print("TX amplitude:", self[AMPLITUDE_KEY])
def set_amplitude(self, amplitude):
if amplitude < 0.0 or amplitude > 1.0:
if self._verbose:
- print "Amplitude out of range:", amplitude
+ print("Amplitude out of range:", amplitude)
return False
if self[TYPE_KEY] in (analog.GR_SIN_WAVE, analog.GR_CONST_WAVE, analog.GR_GAUSSIAN, analog.GR_UNIFORM):
@@ -466,7 +466,7 @@ class top_block(gr.top_block, pubsub):
return True # Waveform not yet set
if self._verbose:
- print "Set amplitude to:", amplitude
+ print("Set amplitude to:", amplitude)
return True
def get_options():
@@ -525,19 +525,19 @@ def get_options():
# the below does not run.
def test_main():
if gr.enable_realtime_scheduling() != gr.RT_OK:
- print "Note: failed to enable realtime scheduling, continuing"
+ print("Note: failed to enable realtime scheduling, continuing")
# Grab command line options and create top block
try:
(options, args) = get_options()
tb = top_block(options, args)
- except RuntimeError, e:
- print e
+ except RuntimeError as e:
+ print(e)
sys.exit(1)
tb.start()
- raw_input('Press Enter to quit: ')
+ input('Press Enter to quit: ')
tb.stop()
tb.wait()
diff --git a/apps/osmocom_siggen_nogui b/apps/osmocom_siggen_nogui
index 0283fcf..5370cd0 100755
--- a/apps/osmocom_siggen_nogui
+++ b/apps/osmocom_siggen_nogui
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright 2008,2009,2011,2012 Free Software Foundation, Inc.
#
@@ -26,19 +26,19 @@ import sys
def main():
if gr.enable_realtime_scheduling() != gr.RT_OK:
- print "Note: failed to enable realtime scheduling, continuing"
+ print("Note: failed to enable realtime scheduling, continuing")
# Grab command line options and create top block
try:
(options, args) = osmocom_siggen.get_options()
tb = osmocom_siggen.top_block(options, args)
- except RuntimeError, e:
- print e
+ except RuntimeError as e:
+ print(e)
sys.exit(1)
tb.start()
- raw_input('Press Enter to quit: ')
+ input('Press Enter to quit: ')
tb.stop()
tb.wait()
diff --git a/apps/osmocom_spectrum_sense b/apps/osmocom_spectrum_sense
index ea365bb..9fea6f0 100755
--- a/apps/osmocom_spectrum_sense
+++ b/apps/osmocom_spectrum_sense
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright 2005,2007,2011 Free Software Foundation, Inc.
#
@@ -71,13 +71,13 @@ class tune(gr.feval_dd):
# wait until msgq is empty before continuing
while(self.tb.msgq.full_p()):
- #print "msgq full, holding.."
+ #print("msgq full, holding..")
time.sleep(0.1)
return new_freq
- except Exception, e:
- print "tune: Exception: ", e
+ except Exception as e:
+ print("tune: Exception: ", e)
class parse_msg(object):
@@ -147,7 +147,7 @@ class my_top_block(gr.top_block):
realtime = True
else:
realtime = False
- print "Note: failed to enable realtime scheduling"
+ print("Note: failed to enable realtime scheduling")
# build graph
self.u = osmosdr.source(options.args)
@@ -155,7 +155,7 @@ class my_top_block(gr.top_block):
try:
self.u.get_sample_rates().start()
except RuntimeError:
- print "Source has no sample rates (wrong device arguments?)."
+ print("Source has no sample rates (wrong device arguments?).")
sys.exit(1)
# Set the antenna
@@ -218,7 +218,7 @@ class my_top_block(gr.top_block):
options.gain = float(g.start()+g.stop())/2.0
self.set_gain(options.gain)
- print "gain =", options.gain
+ print("gain =", options.gain)
def set_next_freq(self):
target_freq = self.next_freq
@@ -227,7 +227,7 @@ class my_top_block(gr.top_block):
self.next_freq = self.min_center_freq
if not self.set_freq(target_freq):
- print "Failed to set frequency to", target_freq
+ print("Failed to set frequency to", target_freq)
sys.exit(1)
return target_freq
@@ -259,9 +259,9 @@ def main_loop(tb):
def bin_freq(i_bin, center_freq):
#hz_per_bin = tb.usrp_rate / tb.fft_size
freq = center_freq - (tb.usrp_rate / 2) + (tb.channel_bandwidth * i_bin)
- #print "freq original:",freq
+ #print("freq original:",freq)
#freq = nearest_freq(freq, tb.channel_bandwidth)
- #print "freq rounded:",freq
+ #print("freq rounded:",freq)
return freq
bin_start = int(tb.fft_size * ((1 - 0.75) / 2))
@@ -287,7 +287,7 @@ def main_loop(tb):
power_db = 10*math.log10(m.data[i_bin]/tb.usrp_rate) - noise_floor_db
if (power_db > tb.squelch_threshold) and (freq >= tb.min_freq) and (freq <= tb.max_freq):
- print datetime.now(), "center_freq", center_freq, "freq", freq, "power_db", power_db, "noise_floor_db", noise_floor_db
+ print(datetime.now(), "center_freq", center_freq, "freq", freq, "power_db", power_db, "noise_floor_db", noise_floor_db)
if __name__ == '__main__':
t = ThreadClass()
diff --git a/cmake/Modules/CMakeParseArgumentsCopy.cmake b/cmake/Modules/CMakeParseArgumentsCopy.cmake
deleted file mode 100644
index 7ce4c49..0000000
--- a/cmake/Modules/CMakeParseArgumentsCopy.cmake
+++ /dev/null
@@ -1,138 +0,0 @@
-# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
-#
-# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
-# parsing the arguments given to that macro or function.
-# It processes the arguments and defines a set of variables which hold the
-# values of the respective options.
-#
-# The <options> argument contains all options for the respective macro,
-# i.e. keywords which can be used when calling the macro without any value
-# following, like e.g. the OPTIONAL keyword of the install() command.
-#
-# The <one_value_keywords> argument contains all keywords for this macro
-# which are followed by one value, like e.g. DESTINATION keyword of the
-# install() command.
-#
-# The <multi_value_keywords> argument contains all keywords for this macro
-# which can be followed by more than one value, like e.g. the TARGETS or
-# FILES keywords of the install() command.
-#
-# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
-# keywords listed in <options>, <one_value_keywords> and
-# <multi_value_keywords> a variable composed of the given <prefix>
-# followed by "_" and the name of the respective keyword.
-# These variables will then hold the respective value from the argument list.
-# For the <options> keywords this will be TRUE or FALSE.
-#
-# All remaining arguments are collected in a variable
-# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
-# your macro was called with unrecognized parameters.
-#
-# As an example here a my_install() macro, which takes similar arguments as the
-# real install() command:
-#
-# function(MY_INSTALL)
-# set(options OPTIONAL FAST)
-# set(oneValueArgs DESTINATION RENAME)
-# set(multiValueArgs TARGETS CONFIGURATIONS)
-# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
-# ...
-#
-# Assume my_install() has been called like this:
-# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
-#
-# After the cmake_parse_arguments() call the macro will have set the following
-# variables:
-# MY_INSTALL_OPTIONAL = TRUE
-# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
-# MY_INSTALL_DESTINATION = "bin"
-# MY_INSTALL_RENAME = "" (was not used)
-# MY_INSTALL_TARGETS = "foo;bar"
-# MY_INSTALL_CONFIGURATIONS = "" (was not used)
-# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
-#
-# You can the continue and process these variables.
-#
-# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
-# another recognized keyword follows, this is interpreted as the beginning of
-# the new option.
-# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
-# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
-# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
-
-#=============================================================================
-# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-
-if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
- return()
-endif()
-set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
-
-
-function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
- # first set all result variables to empty/FALSE
- foreach(arg_name ${_singleArgNames} ${_multiArgNames})
- set(${prefix}_${arg_name})
- endforeach(arg_name)
-
- foreach(option ${_optionNames})
- set(${prefix}_${option} FALSE)
- endforeach(option)
-
- set(${prefix}_UNPARSED_ARGUMENTS)
-
- set(insideValues FALSE)
- set(currentArgName)
-
- # now iterate over all arguments and fill the result variables
- foreach(currentArg ${ARGN})
- list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
- list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
- list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
-
- if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
- if(insideValues)
- if("${insideValues}" STREQUAL "SINGLE")
- set(${prefix}_${currentArgName} ${currentArg})
- set(insideValues FALSE)
- elseif("${insideValues}" STREQUAL "MULTI")
- list(APPEND ${prefix}_${currentArgName} ${currentArg})
- endif()
- else(insideValues)
- list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
- endif(insideValues)
- else()
- if(NOT ${optionIndex} EQUAL -1)
- set(${prefix}_${currentArg} TRUE)
- set(insideValues FALSE)
- elseif(NOT ${singleArgIndex} EQUAL -1)
- set(currentArgName ${currentArg})
- set(${prefix}_${currentArgName})
- set(insideValues "SINGLE")
- elseif(NOT ${multiArgIndex} EQUAL -1)
- set(currentArgName ${currentArg})
- set(${prefix}_${currentArgName})
- set(insideValues "MULTI")
- endif()
- endif()
-
- endforeach(currentArg)
-
- # propagate the result variables to the caller:
- foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
- set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
- endforeach(arg_name)
- set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
-
-endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
diff --git a/cmake/Modules/FindGnuradioFCD.cmake b/cmake/Modules/FindGnuradioFCD.cmake
deleted file mode 100644
index e7d7670..0000000
--- a/cmake/Modules/FindGnuradioFCD.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(PC_GNURADIO_FCD gnuradio-fcd)
-
-FIND_PATH(
- GNURADIO_FCD_INCLUDE_DIRS
- NAMES gnuradio/fcd/api.h
- HINTS $ENV{GNURADIO_FCD_DIR}/include
- ${PC_GNURADIO_FCD_INCLUDEDIR}
- PATHS /usr/local/include
- /usr/include
-)
-
-FIND_LIBRARY(
- GNURADIO_FCD_LIBRARIES
- NAMES gnuradio-fcd
- HINTS $ENV{GNURADIO_FCD_DIR}/lib
- ${PC_GNURADIO_FCD_LIBDIR}
- PATHS /usr/local/lib
- /usr/local/lib64
- /usr/lib
- /usr/lib64
-)
-
-if(GNURADIO_FCD_INCLUDE_DIRS AND GNURADIO_FCD_LIBRARIES)
- set(GNURADIO_FCD_FOUND TRUE CACHE INTERNAL "gnuradio-fcd found")
- message(STATUS "Found gnuradio-fcd: ${GNURADIO_FCD_INCLUDE_DIRS}, ${GNURADIO_FCD_LIBRARIES}")
-else(GNURADIO_FCD_INCLUDE_DIRS AND GNURADIO_FCD_LIBRARIES)
- set(GNURADIO_FCD_FOUND FALSE CACHE INTERNAL "gnuradio-fcd found")
- message(STATUS "gnuradio-fcd not found.")
-endif(GNURADIO_FCD_INCLUDE_DIRS AND GNURADIO_FCD_LIBRARIES)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_FCD DEFAULT_MSG GNURADIO_FCD_LIBRARIES GNURADIO_FCD_INCLUDE_DIRS)
-MARK_AS_ADVANCED(GNURADIO_FCD_LIBRARIES GNURADIO_FCD_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindGnuradioFCDPP.cmake b/cmake/Modules/FindGnuradioFCDPP.cmake
deleted file mode 100644
index c6f03f1..0000000
--- a/cmake/Modules/FindGnuradioFCDPP.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(PC_GNURADIO_FCDPP gnuradio-fcdproplus)
-
-FIND_PATH(
- GNURADIO_FCDPP_INCLUDE_DIRS
- NAMES fcdproplus/api.h
- HINTS $ENV{GNURADIO_FCDPP_DIR}/include
- ${PC_GNURADIO_FCDPP_INCLUDEDIR}
- PATHS /usr/local/include
- /usr/include
-)
-
-FIND_LIBRARY(
- GNURADIO_FCDPP_LIBRARIES
- NAMES gnuradio-fcdproplus
- HINTS $ENV{GNURADIO_FCDPP_DIR}/lib
- ${PC_GNURADIO_FCDPP_LIBDIR}
- PATHS /usr/local/lib
- /usr/local/lib64
- /usr/lib
- /usr/lib64
-)
-
-if(GNURADIO_FCDPP_INCLUDE_DIRS AND GNURADIO_FCDPP_LIBRARIES)
- set(GNURADIO_FCDPP_FOUND TRUE CACHE INTERNAL "gnuradio-fcdproplus found")
- message(STATUS "Found gnuradio-fcdproplus: ${GNURADIO_FCDPP_INCLUDE_DIRS}, ${GNURADIO_FCDPP_LIBRARIES}")
-else(GNURADIO_FCDPP_INCLUDE_DIRS AND GNURADIO_FCDPP_LIBRARIES)
- set(GNURADIO_FCDPP_FOUND FALSE CACHE INTERNAL "gnuradio-fcdproplus found")
- message(STATUS "gnuradio-fcdproplus not found.")
-endif(GNURADIO_FCDPP_INCLUDE_DIRS AND GNURADIO_FCDPP_LIBRARIES)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_FCDPP DEFAULT_MSG GNURADIO_FCDPP_LIBRARIES GNURADIO_FCDPP_INCLUDE_DIRS)
-MARK_AS_ADVANCED(GNURADIO_FCDPP_LIBRARIES GNURADIO_FCDPP_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindGnuradioFuncube.cmake b/cmake/Modules/FindGnuradioFuncube.cmake
new file mode 100644
index 0000000..0ed72cb
--- /dev/null
+++ b/cmake/Modules/FindGnuradioFuncube.cmake
@@ -0,0 +1,27 @@
+if(NOT GNURADIO_FUNCUBE_FOUND)
+ pkg_check_modules (GNURADIO_FUNCUBE_PKG libgnuradio-funcube)
+ find_path(GNURADIO_FUNCUBE_INCLUDE_DIRS NAMES funcube/api.h
+ PATHS
+ ${GNURADIO_FUNCUBE_PKG_INCLUDE_DIRS}
+ /usr/include
+ /usr/local/include
+ )
+
+ find_library(GNURADIO_FUNCUBE_LIBRARIES NAMES gnuradio-funcube
+ PATHS
+ ${GNURADIO_FUNCUBE_PKG_LIBRARY_DIRS}
+ /usr/lib
+ /usr/local/lib
+ )
+
+if(GNURADIO_FUNCUBE_INCLUDE_DIRS AND GNURADIO_FUNCUBE_LIBRARIES)
+ set(GNURADIO_FUNCUBE_FOUND TRUE CACHE INTERNAL "gnuradio-funcube found")
+ message(STATUS "Found gnuradio-funcube: ${GNURADIO_FUNCUBE_INCLUDE_DIRS}, ${GNURADIO_FUNCUBE_LIBRARIES}")
+else(GNURADIO_FUNCUBE_INCLUDE_DIRS AND GNURADIO_FUNCUBE_LIBRARIES)
+ set(GNURADIO_FUNCUBE_FOUND FALSE CACHE INTERNAL "gnuradio-funcube found")
+ message(STATUS "gnuradio-funcube not found.")
+endif(GNURADIO_FUNCUBE_INCLUDE_DIRS AND GNURADIO_FUNCUBE_LIBRARIES)
+
+mark_as_advanced(GNURADIO_FUNCUBE_LIBRARIES GNURADIO_FUNCUBE_INCLUDE_DIRS)
+
+endif(NOT GNURADIO_FUNCUBE_FOUND)
diff --git a/cmake/Modules/FindGnuradioIQBalance.cmake b/cmake/Modules/FindGnuradioIQBalance.cmake
deleted file mode 100644
index c381d1c..0000000
--- a/cmake/Modules/FindGnuradioIQBalance.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(PC_GNURADIO_IQBALANCE gnuradio-iqbalance)
-
-FIND_PATH(
- GNURADIO_IQBALANCE_INCLUDE_DIRS
- NAMES gnuradio/iqbalance/api.h
- HINTS $ENV{GNURADIO_IQBALANCE_DIR}/include
- ${PC_GNURADIO_IQBALANCE_INCLUDEDIR}
- ${CMAKE_INSTALL_PREFIX}/include
- PATHS /usr/local/include
- /usr/include
-)
-
-FIND_LIBRARY(
- GNURADIO_IQBALANCE_LIBRARIES
- NAMES gnuradio-iqbalance
- HINTS $ENV{GNURADIO_IQBALANCE_DIR}/lib
- ${PC_GNURADIO_IQBALANCE_LIBDIR}
- ${CMAKE_INSTALL_PREFIX}/lib64
- ${CMAKE_INSTALL_PREFIX}/lib
- PATHS /usr/local/lib
- /usr/local/lib64
- /usr/lib
- /usr/lib64
-)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_IQBALANCE DEFAULT_MSG GNURADIO_IQBALANCE_LIBRARIES GNURADIO_IQBALANCE_INCLUDE_DIRS)
-MARK_AS_ADVANCED(GNURADIO_IQBALANCE_LIBRARIES GNURADIO_IQBALANCE_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindGnuradioUHD.cmake b/cmake/Modules/FindGnuradioUHD.cmake
deleted file mode 100644
index f99daf0..0000000
--- a/cmake/Modules/FindGnuradioUHD.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(PC_GNURADIO_UHD gnuradio-uhd)
-
-FIND_PATH(
- GNURADIO_UHD_INCLUDE_DIRS
- NAMES gnuradio/uhd/api.h
- HINTS $ENV{GNURADIO_UHD_DIR}/include
- ${PC_GNURADIO_UHD_INCLUDEDIR}
- PATHS /usr/local/include
- /usr/include
-)
-
-FIND_LIBRARY(
- GNURADIO_UHD_LIBRARIES
- NAMES gnuradio-uhd
- HINTS $ENV{GNURADIO_UHD_DIR}/lib
- ${PC_GNURADIO_UHD_LIBDIR}
- PATHS /usr/local/lib
- /usr/local/lib64
- /usr/lib
- /usr/lib64
-)
-
-if(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES)
- set(GNURADIO_UHD_FOUND TRUE CACHE INTERNAL "gnuradio-uhd found")
- message(STATUS "Found gnuradio-uhd: ${GNURADIO_UHD_INCLUDE_DIRS}, ${GNURADIO_UHD_LIBRARIES}")
-else(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES)
- set(GNURADIO_UHD_FOUND FALSE CACHE INTERNAL "gnuradio-uhd found")
- message(STATUS "gnuradio-uhd not found.")
-endif(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_UHD DEFAULT_MSG GNURADIO_UHD_LIBRARIES GNURADIO_UHD_INCLUDE_DIRS)
-MARK_AS_ADVANCED(GNURADIO_UHD_LIBRARIES GNURADIO_UHD_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindLibAIRSPY.cmake b/cmake/Modules/FindLibAIRSPY.cmake
index 221edcc..437adc4 100644
--- a/cmake/Modules/FindLibAIRSPY.cmake
+++ b/cmake/Modules/FindLibAIRSPY.cmake
@@ -1,4 +1,6 @@
-INCLUDE(FindPkgConfig)
+if(NOT PKG_CONFIG_FOUND)
+ INCLUDE(FindPkgConfig)
+endif()
PKG_CHECK_MODULES(PC_LIBAIRSPY libairspy)
FIND_PATH(
@@ -20,5 +22,5 @@ FIND_LIBRARY(
)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAIRSPY DEFAULT_MSG LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibAIRSPY DEFAULT_MSG LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS)
MARK_AS_ADVANCED(LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindLibAIRSPYHF.cmake b/cmake/Modules/FindLibAIRSPYHF.cmake
new file mode 100644
index 0000000..8c06128
--- /dev/null
+++ b/cmake/Modules/FindLibAIRSPYHF.cmake
@@ -0,0 +1,26 @@
+if(NOT PKG_CONFIG_FOUND)
+ INCLUDE(FindPkgConfig)
+endif()
+PKG_CHECK_MODULES(PC_LIBAIRSPYHF libairspyhf)
+
+FIND_PATH(
+ LIBAIRSPYHF_INCLUDE_DIRS
+ NAMES libairspyhf/airspyhf.h
+ HINTS $ENV{LIBAIRSPYHF_DIR}/include
+ ${PC_LIBAIRSPYHF_INCLUDEDIR}
+ PATHS /usr/local/include
+ /usr/include
+)
+
+FIND_LIBRARY(
+ LIBAIRSPYHF_LIBRARIES
+ NAMES airspyhf
+ HINTS $ENV{LIBAIRSPYHF_DIR}/lib
+ ${PC_LIBAIRSPYHF_LIBDIR}
+ PATHS /usr/local/lib
+ /usr/lib
+)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibAIRSPYHF DEFAULT_MSG LIBAIRSPYHF_LIBRARIES LIBAIRSPYHF_INCLUDE_DIRS)
+MARK_AS_ADVANCED(LIBAIRSPYHF_LIBRARIES LIBAIRSPYHF_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindLibHackRF.cmake b/cmake/Modules/FindLibHackRF.cmake
index a0d57ef..bc2bc3e 100644
--- a/cmake/Modules/FindLibHackRF.cmake
+++ b/cmake/Modules/FindLibHackRF.cmake
@@ -1,4 +1,6 @@
-INCLUDE(FindPkgConfig)
+if(NOT PKG_CONFIG_FOUND)
+ INCLUDE(FindPkgConfig)
+endif()
PKG_CHECK_MODULES(PC_LIBHACKRF libhackrf)
FIND_PATH(
@@ -20,6 +22,6 @@ FIND_LIBRARY(
)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBHACKRF DEFAULT_MSG LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibHackRF DEFAULT_MSG LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS)
MARK_AS_ADVANCED(LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindLibOsmoSDR.cmake b/cmake/Modules/FindLibOsmoSDR.cmake
deleted file mode 100644
index a772e68..0000000
--- a/cmake/Modules/FindLibOsmoSDR.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-if(NOT LIBOSMOSDR_FOUND)
- pkg_check_modules (LIBOSMOSDR_PKG libosmosdr)
- find_path(LIBOSMOSDR_INCLUDE_DIRS NAMES osmosdr.h
- PATHS
- ${LIBOSMOSDR_PKG_INCLUDE_DIRS}
- /usr/include
- /usr/local/include
- )
-
- find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr
- PATHS
- ${LIBOSMOSDR_PKG_LIBRARY_DIRS}
- /usr/lib
- /usr/local/lib
- )
-
-if(LIBOSMOSDR_INCLUDE_DIRS AND LIBOSMOSDR_LIBRARIES)
- set(LIBOSMOSDR_FOUND TRUE CACHE INTERNAL "libosmosdr found")
- message(STATUS "Found libosmosdr: ${LIBOSMOSDR_INCLUDE_DIRS}, ${LIBOSMOSDR_LIBRARIES}")
-else(LIBOSMOSDR_INCLUDE_DIRS AND LIBOSMOSDR_LIBRARIES)
- set(LIBOSMOSDR_FOUND FALSE CACHE INTERNAL "libosmosdr found")
- message(STATUS "libosmosdr not found.")
-endif(LIBOSMOSDR_INCLUDE_DIRS AND LIBOSMOSDR_LIBRARIES)
-
-mark_as_advanced(LIBOSMOSDR_LIBRARIES LIBOSMOSDR_INCLUDE_DIRS)
-
-endif(NOT LIBOSMOSDR_FOUND)
diff --git a/cmake/Modules/FindLibXTRX.cmake b/cmake/Modules/FindLibXTRX.cmake
new file mode 100644
index 0000000..e7681d1
--- /dev/null
+++ b/cmake/Modules/FindLibXTRX.cmake
@@ -0,0 +1,27 @@
+if(NOT LIBXTRX_FOUND)
+ pkg_check_modules (LIBXTRX_PKG libxtrx)
+ find_path(LIBXTRX_INCLUDE_DIRS NAMES xtrx_api.h
+ PATHS
+ ${LIBXTRX_PKG_INCLUDE_DIRS}
+ /usr/include
+ /usr/local/include
+ )
+
+ find_library(LIBXTRX_LIBRARIES NAMES xtrx
+ PATHS
+ ${LIBXTRX_PKG_LIBRARY_DIRS}
+ /usr/lib
+ /usr/local/lib
+ )
+
+if(LIBXTRX_INCLUDE_DIRS AND LIBXTRX_LIBRARIES)
+ set(LIBXTRX_FOUND TRUE CACHE INTERNAL "libxtrx found")
+ message(STATUS "Found libxtrx: ${LIBXTRX_INCLUDE_DIRS}, ${LIBXTRX_LIBRARIES}")
+else(LIBXTRX_INCLUDE_DIRS AND LIBXTRX_LIBRARIES)
+ set(LIBXTRX_FOUND FALSE CACHE INTERNAL "libxtrx found")
+ message(STATUS "libxtrx not found.")
+endif(LIBXTRX_INCLUDE_DIRS AND LIBXTRX_LIBRARIES)
+
+mark_as_advanced(LIBXTRX_LIBRARIES LIBXTRX_INCLUDE_DIRS)
+
+endif(NOT LIBXTRX_FOUND)
diff --git a/cmake/Modules/FindLibbladeRF.cmake b/cmake/Modules/FindLibbladeRF.cmake
index 0971344..fc67082 100644
--- a/cmake/Modules/FindLibbladeRF.cmake
+++ b/cmake/Modules/FindLibbladeRF.cmake
@@ -1,5 +1,9 @@
if(NOT LIBBLADERF_FOUND)
pkg_check_modules (LIBBLADERF_PKG libbladeRF)
+ if (LIBBLADERF_PKG_FOUND AND LIBBLADERF_PKG_VERSION VERSION_LESS "2")
+ message( FATAL_ERROR "Install version 2 or greater of libbladeRF."
+ " Current version ( ${LIBBLADERF_PKG_VERSION} ) is out of date." )
+ endif()
find_path(LIBBLADERF_INCLUDE_DIRS NAMES libbladeRF.h
PATHS
${LIBBLADERF_PKG_INCLUDE_DIRS}
diff --git a/cmake/Modules/GrComponent.cmake b/cmake/Modules/GrComponent.cmake
deleted file mode 100644
index 22b0ea4..0000000
--- a/cmake/Modules/GrComponent.cmake
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 2010-2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-if(DEFINED __INCLUDED_GR_COMPONENT_CMAKE)
- return()
-endif()
-set(__INCLUDED_GR_COMPONENT_CMAKE TRUE)
-
-set(_gr_enabled_components "" CACHE INTERNAL "" FORCE)
-set(_gr_disabled_components "" CACHE INTERNAL "" FORCE)
-
-if(NOT DEFINED ENABLE_DEFAULT)
- set(ENABLE_DEFAULT ON)
- message(STATUS "")
- message(STATUS "The build system will automatically enable all components.")
- message(STATUS "Use -DENABLE_DEFAULT=OFF to disable components by default.")
-endif()
-
-########################################################################
-# Register a component into the system
-# - name: canonical component name
-# - var: variable for enabled status
-# - argn: list of dependencies
-########################################################################
-function(GR_REGISTER_COMPONENT name var)
- include(CMakeDependentOption)
- message(STATUS "")
- message(STATUS "Configuring ${name} support...")
- foreach(dep ${ARGN})
- message(STATUS " Dependency ${dep} = ${${dep}}")
- endforeach(dep)
-
- #if the user set the var to force, we note this
- if("${${var}}" STREQUAL "FORCE")
- set(${var} ON)
- set(var_force TRUE)
- else()
- set(var_force FALSE)
- endif()
-
- #rewrite the dependency list so that deps that are also components use the cached version
- unset(comp_deps)
- foreach(dep ${ARGN})
- list(FIND _gr_enabled_components ${dep} dep_enb_index)
- list(FIND _gr_disabled_components ${dep} dep_dis_index)
- if (${dep_enb_index} EQUAL -1 AND ${dep_dis_index} EQUAL -1)
- list(APPEND comp_deps ${dep})
- else()
- list(APPEND comp_deps ${dep}_cached) #is a component, use cached version
- endif()
- endforeach(dep)
-
- #setup the dependent option for this component
- CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${ENABLE_DEFAULT} "${comp_deps}" OFF)
- set(${var} "${${var}}" PARENT_SCOPE)
- set(${var}_cached "${${var}}" CACHE INTERNAL "" FORCE)
-
- #force was specified, but the dependencies were not met
- if(NOT ${var} AND var_force)
- message(FATAL_ERROR "user force-enabled ${name} but configuration checked failed")
- endif()
-
- #append the component into one of the lists
- if(${var})
- message(STATUS " Enabling ${name} support.")
- list(APPEND _gr_enabled_components ${name})
- else(${var})
- message(STATUS " Disabling ${name} support.")
- list(APPEND _gr_disabled_components ${name})
- endif(${var})
- message(STATUS " Override with -D${var}=ON/OFF")
-
- #make components lists into global variables
- set(_gr_enabled_components ${_gr_enabled_components} CACHE INTERNAL "" FORCE)
- set(_gr_disabled_components ${_gr_disabled_components} CACHE INTERNAL "" FORCE)
-endfunction(GR_REGISTER_COMPONENT)
-
-########################################################################
-# Print the registered component summary
-########################################################################
-function(GR_PRINT_COMPONENT_SUMMARY)
- message(STATUS "")
- message(STATUS "######################################################")
- message(STATUS "# gr-osmosdr enabled components ")
- message(STATUS "######################################################")
- foreach(comp ${_gr_enabled_components})
- message(STATUS " * ${comp}")
- endforeach(comp)
-
- message(STATUS "")
- message(STATUS "######################################################")
- message(STATUS "# gr-osmosdr disabled components ")
- message(STATUS "######################################################")
- foreach(comp ${_gr_disabled_components})
- message(STATUS " * ${comp}")
- endforeach(comp)
-
- message(STATUS "")
-endfunction(GR_PRINT_COMPONENT_SUMMARY)
diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake
deleted file mode 100644
index 747eb1a..0000000
--- a/cmake/Modules/GrMiscUtils.cmake
+++ /dev/null
@@ -1,519 +0,0 @@
-# Copyright 2010-2011,2014 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-if(DEFINED __INCLUDED_GR_MISC_UTILS_CMAKE)
- return()
-endif()
-set(__INCLUDED_GR_MISC_UTILS_CMAKE TRUE)
-
-########################################################################
-# Set global variable macro.
-# Used for subdirectories to export settings.
-# Example: include and library paths.
-########################################################################
-function(GR_SET_GLOBAL var)
- set(${var} ${ARGN} CACHE INTERNAL "" FORCE)
-endfunction(GR_SET_GLOBAL)
-
-########################################################################
-# Set the pre-processor definition if the condition is true.
-# - def the pre-processor definition to set and condition name
-########################################################################
-function(GR_ADD_COND_DEF def)
- if(${def})
- add_definitions(-D${def})
- endif(${def})
-endfunction(GR_ADD_COND_DEF)
-
-########################################################################
-# Check for a header and conditionally set a compile define.
-# - hdr the relative path to the header file
-# - def the pre-processor definition to set
-########################################################################
-function(GR_CHECK_HDR_N_DEF hdr def)
- include(CheckIncludeFileCXX)
- CHECK_INCLUDE_FILE_CXX(${hdr} ${def})
- GR_ADD_COND_DEF(${def})
-endfunction(GR_CHECK_HDR_N_DEF)
-
-########################################################################
-# Include subdirectory macro.
-# Sets the CMake directory variables,
-# includes the subdirectory CMakeLists.txt,
-# resets the CMake directory variables.
-#
-# This macro includes subdirectories rather than adding them
-# so that the subdirectory can affect variables in the level above.
-# This provides a work-around for the lack of convenience libraries.
-# This way a subdirectory can append to the list of library sources.
-########################################################################
-macro(GR_INCLUDE_SUBDIRECTORY subdir)
- #insert the current directories on the front of the list
- list(INSERT _cmake_source_dirs 0 ${CMAKE_CURRENT_SOURCE_DIR})
- list(INSERT _cmake_binary_dirs 0 ${CMAKE_CURRENT_BINARY_DIR})
-
- #set the current directories to the names of the subdirs
- set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${subdir})
- set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${subdir})
-
- #include the subdirectory CMakeLists to run it
- file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
- include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
-
- #reset the value of the current directories
- list(GET _cmake_source_dirs 0 CMAKE_CURRENT_SOURCE_DIR)
- list(GET _cmake_binary_dirs 0 CMAKE_CURRENT_BINARY_DIR)
-
- #pop the subdir names of the front of the list
- list(REMOVE_AT _cmake_source_dirs 0)
- list(REMOVE_AT _cmake_binary_dirs 0)
-endmacro(GR_INCLUDE_SUBDIRECTORY)
-
-########################################################################
-# Check if a compiler flag works and conditionally set a compile define.
-# - flag the compiler flag to check for
-# - have the variable to set with result
-########################################################################
-macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
- include(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG(${flag} ${have})
- if(${have})
- add_definitions(${flag})
- endif(${have})
-endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
-
-########################################################################
-# Generates the .la libtool file
-# This appears to generate libtool files that cannot be used by auto*.
-# Usage GR_LIBTOOL(TARGET [target] DESTINATION [dest])
-# Notice: there is not COMPONENT option, these will not get distributed.
-########################################################################
-function(GR_LIBTOOL)
- if(NOT DEFINED GENERATE_LIBTOOL)
- set(GENERATE_LIBTOOL OFF) #disabled by default
- endif()
-
- if(GENERATE_LIBTOOL)
- include(CMakeParseArgumentsCopy)
- CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN})
-
- find_program(LIBTOOL libtool)
- if(LIBTOOL)
- include(CMakeMacroLibtoolFile)
- CREATE_LIBTOOL_FILE(${GR_LIBTOOL_TARGET} /${GR_LIBTOOL_DESTINATION})
- endif(LIBTOOL)
- endif(GENERATE_LIBTOOL)
-
-endfunction(GR_LIBTOOL)
-
-########################################################################
-# Do standard things to the library target
-# - set target properties
-# - make install rules
-# Also handle gnuradio custom naming conventions w/ extras mode.
-########################################################################
-function(GR_LIBRARY_FOO target)
- #parse the arguments for component names
- include(CMakeParseArgumentsCopy)
- CMAKE_PARSE_ARGUMENTS(GR_LIBRARY "" "RUNTIME_COMPONENT;DEVEL_COMPONENT" "" ${ARGN})
-
- #set additional target properties
- set_target_properties(${target} PROPERTIES SOVERSION ${LIBVER})
-
- #install the generated files like so...
- install(TARGETS ${target}
- LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .so/.dylib file
- ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_DEVEL_COMPONENT} # .lib file
- RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .dll file
- )
-
- #extras mode enabled automatically on linux
- if(NOT DEFINED LIBRARY_EXTRAS)
- set(LIBRARY_EXTRAS ${LINUX})
- endif()
-
- #special extras mode to enable alternative naming conventions
- if(LIBRARY_EXTRAS)
-
- #create .la file before changing props
- GR_LIBTOOL(TARGET ${target} DESTINATION ${GR_LIBRARY_DIR})
-
- #give the library a special name with ultra-zero soversion
- set_target_properties(${target} PROPERTIES OUTPUT_NAME ${target}-${LIBVER} SOVERSION "0.0.0")
- set(target_name lib${target}-${LIBVER}.so.0.0.0)
-
- #custom command to generate symlinks
- add_custom_command(
- TARGET ${target}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
- COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
- COMMAND ${CMAKE_COMMAND} -E touch ${target_name} #so the symlinks point to something valid so cmake 2.6 will install
- )
-
- #and install the extra symlinks
- install(
- FILES
- ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
- ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
- DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT}
- )
-
- endif(LIBRARY_EXTRAS)
-endfunction(GR_LIBRARY_FOO)
-
-########################################################################
-# Create a dummy custom command that depends on other targets.
-# Usage:
-# GR_GEN_TARGET_DEPS(unique_name target_deps <target1> <target2> ...)
-# ADD_CUSTOM_COMMAND(<the usual args> ${target_deps})
-#
-# Custom command cant depend on targets, but can depend on executables,
-# and executables can depend on targets. So this is the process:
-########################################################################
-function(GR_GEN_TARGET_DEPS name var)
- file(
- WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
- "int main(void){return 0;}\n"
- )
- execute_process(
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in
- ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp
- )
- add_executable(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp)
- if(ARGN)
- add_dependencies(${name} ${ARGN})
- endif(ARGN)
-
- if(CMAKE_CROSSCOMPILING)
- set(${var} "DEPENDS;${name}" PARENT_SCOPE) #cant call command when cross
- else()
- set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE)
- endif()
-endfunction(GR_GEN_TARGET_DEPS)
-
-########################################################################
-# Control use of gr_logger
-# Usage:
-# GR_LOGGING()
-#
-# Will set ENABLE_GR_LOG to 1 by default.
-# Can manually set with -DENABLE_GR_LOG=0|1
-########################################################################
-function(GR_LOGGING)
- find_package(Log4cpp)
-
- OPTION(ENABLE_GR_LOG "Use gr_logger" ON)
- if(ENABLE_GR_LOG)
- # If gr_logger is enabled, make it usable
- add_definitions( -DENABLE_GR_LOG )
-
- # also test LOG4CPP; if we have it, use this version of the logger
- # otherwise, default to the stdout/stderr model.
- if(LOG4CPP_FOUND)
- SET(HAVE_LOG4CPP True CACHE INTERNAL "" FORCE)
- add_definitions( -DHAVE_LOG4CPP )
- else(not LOG4CPP_FOUND)
- SET(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE)
- SET(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE)
- endif(LOG4CPP_FOUND)
-
- SET(ENABLE_GR_LOG ${ENABLE_GR_LOG} CACHE INTERNAL "" FORCE)
-
- else(ENABLE_GR_LOG)
- SET(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE)
- SET(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE)
- endif(ENABLE_GR_LOG)
-
- message(STATUS "ENABLE_GR_LOG set to ${ENABLE_GR_LOG}.")
- message(STATUS "HAVE_LOG4CPP set to ${HAVE_LOG4CPP}.")
- message(STATUS "LOG4CPP_LIBRARIES set to ${LOG4CPP_LIBRARIES}.")
-
-endfunction(GR_LOGGING)
-
-########################################################################
-# Run GRCC to compile .grc files into .py files.
-#
-# Usage: GRCC(filename, directory)
-# - filenames: List of file name of .grc file
-# - directory: directory of built .py file - usually in
-# ${CMAKE_CURRENT_BINARY_DIR}
-# - Sets PYFILES: output converted GRC file names to Python files.
-########################################################################
-function(GRCC)
- # Extract directory from list of args, remove it for the list of filenames.
- list(GET ARGV -1 directory)
- list(REMOVE_AT ARGV -1)
- set(filenames ${ARGV})
- file(MAKE_DIRECTORY ${directory})
-
- SET(GRCC_COMMAND ${CMAKE_SOURCE_DIR}/gr-utils/python/grcc)
-
- # GRCC uses some stuff in grc and gnuradio-runtime, so we force
- # the known paths here
- list(APPEND PYTHONPATHS
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}/gnuradio-runtime/python
- ${CMAKE_SOURCE_DIR}/gnuradio-runtime/lib/swig
- ${CMAKE_BINARY_DIR}/gnuradio-runtime/lib/swig
- )
-
- if(WIN32)
- #SWIG generates the python library files into a subdirectory.
- #Therefore, we must append this subdirectory into PYTHONPATH.
- #Only do this for the python directories matching the following:
- foreach(pydir ${PYTHONPATHS})
- get_filename_component(name ${pydir} NAME)
- if(name MATCHES "^(swig|lib|src)$")
- list(APPEND PYTHONPATHS ${pydir}/${CMAKE_BUILD_TYPE})
- endif()
- endforeach(pydir)
- endif(WIN32)
-
- file(TO_NATIVE_PATH "${PYTHONPATHS}" pypath)
-
- if(UNIX)
- list(APPEND pypath "$PYTHONPATH")
- string(REPLACE ";" ":" pypath "${pypath}")
- set(ENV{PYTHONPATH} ${pypath})
- endif(UNIX)
-
- if(WIN32)
- list(APPEND pypath "%PYTHONPATH%")
- string(REPLACE ";" "\\;" pypath "${pypath}")
- #list(APPEND environs "PYTHONPATH=${pypath}")
- set(ENV{PYTHONPATH} ${pypath})
- endif(WIN32)
-
- foreach(f ${filenames})
- execute_process(
- COMMAND ${GRCC_COMMAND} -d ${directory} ${f}
- )
- string(REPLACE ".grc" ".py" pyfile "${f}")
- string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" pyfile "${pyfile}")
- list(APPEND pyfiles ${pyfile})
- endforeach(f)
-
- set(PYFILES ${pyfiles} PARENT_SCOPE)
-endfunction(GRCC)
-
-########################################################################
-# Check if HAVE_PTHREAD_SETSCHEDPARAM and HAVE_SCHED_SETSCHEDULER
-# should be defined
-########################################################################
-macro(GR_CHECK_LINUX_SCHED_AVAIL)
-set(CMAKE_REQUIRED_LIBRARIES -lpthread)
- CHECK_CXX_SOURCE_COMPILES("
- #include <pthread.h>
- int main(){
- pthread_t pthread;
- pthread_setschedparam(pthread, 0, 0);
- return 0;
- } " HAVE_PTHREAD_SETSCHEDPARAM
- )
- GR_ADD_COND_DEF(HAVE_PTHREAD_SETSCHEDPARAM)
-
- CHECK_CXX_SOURCE_COMPILES("
- #include <sched.h>
- int main(){
- pid_t pid;
- sched_setscheduler(pid, 0, 0);
- return 0;
- } " HAVE_SCHED_SETSCHEDULER
- )
- GR_ADD_COND_DEF(HAVE_SCHED_SETSCHEDULER)
-endmacro(GR_CHECK_LINUX_SCHED_AVAIL)
-
-########################################################################
-# Macros to generate source and header files from template
-########################################################################
-macro(GR_EXPAND_X_H component root)
-
- include(GrPython)
-
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-"#!${PYTHON_EXECUTABLE}
-
-import sys, os, re
-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
-
-if __name__ == '__main__':
- import build_utils
- root, inp = sys.argv[1:3]
- for sig in sys.argv[3:]:
- name = re.sub ('X+', sig, root)
- d = build_utils.standard_dict2(name, sig, '${component}')
- build_utils.expand_template(d, inp)
-")
-
- #make a list of all the generated headers
- unset(expanded_files_h)
- foreach(sig ${ARGN})
- string(REGEX REPLACE "X+" ${sig} name ${root})
- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
- endforeach(sig)
- unset(name)
-
- #create a command to generate the headers
- add_custom_command(
- OUTPUT ${expanded_files_h}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
- ${root} ${root}.h.t ${ARGN}
- )
-
- #install rules for the generated headers
- list(APPEND generated_includes ${expanded_files_h})
-
-endmacro(GR_EXPAND_X_H)
-
-macro(GR_EXPAND_X_CC_H component root)
-
- include(GrPython)
-
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-"#!${PYTHON_EXECUTABLE}
-
-import sys, os, re
-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
-
-if __name__ == '__main__':
- import build_utils
- root, inp = sys.argv[1:3]
- for sig in sys.argv[3:]:
- name = re.sub ('X+', sig, root)
- d = build_utils.standard_impl_dict2(name, sig, '${component}')
- build_utils.expand_template(d, inp)
-")
-
- #make a list of all the generated files
- unset(expanded_files_cc)
- unset(expanded_files_h)
- foreach(sig ${ARGN})
- string(REGEX REPLACE "X+" ${sig} name ${root})
- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
- endforeach(sig)
- unset(name)
-
- #create a command to generate the source files
- add_custom_command(
- OUTPUT ${expanded_files_cc}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
- ${root} ${root}.cc.t ${ARGN}
- )
-
- #create a command to generate the header files
- add_custom_command(
- OUTPUT ${expanded_files_h}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
- ${root} ${root}.h.t ${ARGN}
- )
-
- #make source files depends on headers to force generation
- set_source_files_properties(${expanded_files_cc}
- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
- )
-
- #install rules for the generated files
- list(APPEND generated_sources ${expanded_files_cc})
- list(APPEND generated_headers ${expanded_files_h})
-
-endmacro(GR_EXPAND_X_CC_H)
-
-macro(GR_EXPAND_X_CC_H_IMPL component root)
-
- include(GrPython)
-
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-"#!${PYTHON_EXECUTABLE}
-
-import sys, os, re
-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
-
-if __name__ == '__main__':
- import build_utils
- root, inp = sys.argv[1:3]
- for sig in sys.argv[3:]:
- name = re.sub ('X+', sig, root)
- d = build_utils.standard_dict(name, sig, '${component}')
- build_utils.expand_template(d, inp, '_impl')
-")
-
- #make a list of all the generated files
- unset(expanded_files_cc_impl)
- unset(expanded_files_h_impl)
- unset(expanded_files_h)
- foreach(sig ${ARGN})
- string(REGEX REPLACE "X+" ${sig} name ${root})
- list(APPEND expanded_files_cc_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.cc)
- list(APPEND expanded_files_h_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.h)
- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/../include/gnuradio/${component}/${name}.h)
- endforeach(sig)
- unset(name)
-
- #create a command to generate the _impl.cc files
- add_custom_command(
- OUTPUT ${expanded_files_cc_impl}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
- ${root} ${root}_impl.cc.t ${ARGN}
- )
-
- #create a command to generate the _impl.h files
- add_custom_command(
- OUTPUT ${expanded_files_h_impl}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
- ${root} ${root}_impl.h.t ${ARGN}
- )
-
- #make _impl.cc source files depend on _impl.h to force generation
- set_source_files_properties(${expanded_files_cc_impl}
- PROPERTIES OBJECT_DEPENDS "${expanded_files_h_impl}"
- )
-
- #make _impl.h source files depend on headers to force generation
- set_source_files_properties(${expanded_files_h_impl}
- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
- )
-
- #install rules for the generated files
- list(APPEND generated_sources ${expanded_files_cc_impl})
- list(APPEND generated_headers ${expanded_files_h_impl})
-
-endmacro(GR_EXPAND_X_CC_H_IMPL)
diff --git a/cmake/Modules/GrPlatform.cmake b/cmake/Modules/GrPlatform.cmake
deleted file mode 100644
index fbbea5f..0000000
--- a/cmake/Modules/GrPlatform.cmake
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE)
- return()
-endif()
-set(__INCLUDED_GR_PLATFORM_CMAKE TRUE)
-
-########################################################################
-# Setup additional defines for OS types
-########################################################################
-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- set(LINUX TRUE)
-endif()
-
-if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/debian_version")
- set(DEBIAN TRUE)
-endif()
-
-if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/redhat-release")
- set(REDHAT TRUE)
-endif()
-
-if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/slackware-version")
- set(SLACKWARE TRUE)
-endif()
-
-########################################################################
-# when the library suffix should be 64 (applies to redhat linux family)
-########################################################################
-if (REDHAT OR SLACKWARE)
- set(LIB64_CONVENTION TRUE)
-endif()
-
-if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
- set(LIB_SUFFIX 64)
-endif()
-set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
deleted file mode 100644
index 395faff..0000000
--- a/cmake/Modules/GrPython.cmake
+++ /dev/null
@@ -1,242 +0,0 @@
-# Copyright 2010-2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-if(DEFINED __INCLUDED_GR_PYTHON_CMAKE)
- return()
-endif()
-set(__INCLUDED_GR_PYTHON_CMAKE TRUE)
-
-########################################################################
-# Setup the python interpreter:
-# This allows the user to specify a specific interpreter,
-# or finds the interpreter via the built-in cmake module.
-########################################################################
-#this allows the user to override PYTHON_EXECUTABLE
-if(PYTHON_EXECUTABLE)
-
- set(PYTHONINTERP_FOUND TRUE)
-
-#otherwise if not set, try to automatically find it
-else(PYTHON_EXECUTABLE)
-
- #use the built-in find script
- find_package(PythonInterp 2)
-
- #and if that fails use the find program routine
- if(NOT PYTHONINTERP_FOUND)
- find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python2.6 python2.5)
- if(PYTHON_EXECUTABLE)
- set(PYTHONINTERP_FOUND TRUE)
- endif(PYTHON_EXECUTABLE)
- endif(NOT PYTHONINTERP_FOUND)
-
-endif(PYTHON_EXECUTABLE)
-
-if (CMAKE_CROSSCOMPILING)
- set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
-else (CMAKE_CROSSCOMPILING)
- set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
-endif(CMAKE_CROSSCOMPILING)
-
-#make the path to the executable appear in the cmake gui
-set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
-set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")
-
-#make sure we can use -B with python (introduced in 2.6)
-if(PYTHON_EXECUTABLE)
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -B -c ""
- OUTPUT_QUIET ERROR_QUIET
- RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT
- )
- if(PYTHON_HAS_DASH_B_RESULT EQUAL 0)
- set(PYTHON_DASH_B "-B")
- endif()
-endif(PYTHON_EXECUTABLE)
-
-########################################################################
-# Check for the existence of a python module:
-# - desc a string description of the check
-# - mod the name of the module to import
-# - cmd an additional command to run
-# - have the result variable to set
-########################################################################
-macro(GR_PYTHON_CHECK_MODULE desc mod cmd have)
- message(STATUS "")
- message(STATUS "Python checking for ${desc}")
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "
-#########################################
-try:
- import ${mod}
- assert ${cmd}
-except ImportError, AssertionError: exit(-1)
-except: pass
-#########################################"
- RESULT_VARIABLE ${have}
- )
- if(${have} EQUAL 0)
- message(STATUS "Python checking for ${desc} - found")
- set(${have} TRUE)
- else(${have} EQUAL 0)
- message(STATUS "Python checking for ${desc} - not found")
- set(${have} FALSE)
- endif(${have} EQUAL 0)
-endmacro(GR_PYTHON_CHECK_MODULE)
-
-########################################################################
-# Sets the python installation directory GR_PYTHON_DIR
-########################################################################
-if(NOT DEFINED GR_PYTHON_DIR)
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
-from distutils import sysconfig
-print sysconfig.get_python_lib(plat_specific=True, prefix='')
-" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
-)
-endif()
-file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
-
-########################################################################
-# Create an always-built target with a unique name
-# Usage: GR_UNIQUE_TARGET(<description> <dependencies list>)
-########################################################################
-function(GR_UNIQUE_TARGET desc)
- file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
- execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
-unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5]
-print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
- OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE)
- add_custom_target(${_target} ALL DEPENDS ${ARGN})
-endfunction(GR_UNIQUE_TARGET)
-
-########################################################################
-# Install python sources (also builds and installs byte-compiled python)
-########################################################################
-function(GR_PYTHON_INSTALL)
- include(CMakeParseArgumentsCopy)
- CMAKE_PARSE_ARGUMENTS(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN})
-
- ####################################################################
- if(GR_PYTHON_INSTALL_FILES)
- ####################################################################
- install(${ARGN}) #installs regular python files
-
- #create a list of all generated files
- unset(pysrcfiles)
- unset(pycfiles)
- unset(pyofiles)
- foreach(pyfile ${GR_PYTHON_INSTALL_FILES})
- get_filename_component(pyfile ${pyfile} ABSOLUTE)
- list(APPEND pysrcfiles ${pyfile})
-
- #determine if this file is in the source or binary directory
- file(RELATIVE_PATH source_rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${pyfile})
- string(LENGTH "${source_rel_path}" source_rel_path_len)
- file(RELATIVE_PATH binary_rel_path ${CMAKE_CURRENT_BINARY_DIR} ${pyfile})
- string(LENGTH "${binary_rel_path}" binary_rel_path_len)
-
- #and set the generated path appropriately
- if(${source_rel_path_len} GREATER ${binary_rel_path_len})
- set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${binary_rel_path})
- else()
- set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${source_rel_path})
- endif()
- list(APPEND pycfiles ${pygenfile}c)
- list(APPEND pyofiles ${pygenfile}o)
-
- #ensure generation path exists
- get_filename_component(pygen_path ${pygenfile} PATH)
- file(MAKE_DIRECTORY ${pygen_path})
-
- endforeach(pyfile)
-
- #the command to generate the pyc files
- add_custom_command(
- DEPENDS ${pysrcfiles} OUTPUT ${pycfiles}
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles}
- )
-
- #the command to generate the pyo files
- add_custom_command(
- DEPENDS ${pysrcfiles} OUTPUT ${pyofiles}
- COMMAND ${PYTHON_EXECUTABLE} -O ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles}
- )
-
- #create install rule and add generated files to target list
- set(python_install_gen_targets ${pycfiles} ${pyofiles})
- install(FILES ${python_install_gen_targets}
- DESTINATION ${GR_PYTHON_INSTALL_DESTINATION}
- COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
- )
-
-
- ####################################################################
- elseif(GR_PYTHON_INSTALL_PROGRAMS)
- ####################################################################
- file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native)
-
- if (CMAKE_CROSSCOMPILING)
- set(pyexe_native "/usr/bin/env python")
- endif()
-
- foreach(pyfile ${GR_PYTHON_INSTALL_PROGRAMS})
- get_filename_component(pyfile_name ${pyfile} NAME)
- get_filename_component(pyfile ${pyfile} ABSOLUTE)
- string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe")
- list(APPEND python_install_gen_targets ${pyexefile})
-
- get_filename_component(pyexefile_path ${pyexefile} PATH)
- file(MAKE_DIRECTORY ${pyexefile_path})
-
- add_custom_command(
- OUTPUT ${pyexefile} DEPENDS ${pyfile}
- COMMAND ${PYTHON_EXECUTABLE} -c
- "open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())"
- COMMENT "Shebangin ${pyfile_name}"
- VERBATIM
- )
-
- #on windows, python files need an extension to execute
- get_filename_component(pyfile_ext ${pyfile} EXT)
- if(WIN32 AND NOT pyfile_ext)
- set(pyfile_name "${pyfile_name}.py")
- endif()
-
- install(PROGRAMS ${pyexefile} RENAME ${pyfile_name}
- DESTINATION ${GR_PYTHON_INSTALL_DESTINATION}
- COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
- )
- endforeach(pyfile)
-
- endif()
-
- GR_UNIQUE_TARGET("pygen" ${python_install_gen_targets})
-
-endfunction(GR_PYTHON_INSTALL)
-
-########################################################################
-# Write the python helper script that generates byte code files
-########################################################################
-file(WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py "
-import sys, py_compile
-files = sys.argv[1:]
-srcs, gens = files[:len(files)/2], files[len(files)/2:]
-for src, gen in zip(srcs, gens):
- py_compile.compile(file=src, cfile=gen, doraise=True)
-")
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
deleted file mode 100644
index f907a51..0000000
--- a/cmake/Modules/GrSwig.cmake
+++ /dev/null
@@ -1,248 +0,0 @@
-# Copyright 2010-2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-if(DEFINED __INCLUDED_GR_SWIG_CMAKE)
- return()
-endif()
-set(__INCLUDED_GR_SWIG_CMAKE TRUE)
-
-include(GrPython)
-
-########################################################################
-# Builds a swig documentation file to be generated into python docstrings
-# Usage: GR_SWIG_MAKE_DOCS(output_file input_path input_path....)
-#
-# Set the following variable to specify extra dependent targets:
-# - GR_SWIG_DOCS_SOURCE_DEPS
-# - GR_SWIG_DOCS_TARGET_DEPS
-########################################################################
-function(GR_SWIG_MAKE_DOCS output_file)
- if(ENABLE_DOXYGEN)
-
- #setup the input files variable list, quote formated
- set(input_files)
- unset(INPUT_PATHS)
- foreach(input_path ${ARGN})
- if (IS_DIRECTORY ${input_path}) #when input path is a directory
- file(GLOB input_path_h_files ${input_path}/*.h)
- else() #otherwise its just a file, no glob
- set(input_path_h_files ${input_path})
- endif()
- list(APPEND input_files ${input_path_h_files})
- set(INPUT_PATHS "${INPUT_PATHS} \"${input_path}\"")
- endforeach(input_path)
-
- #determine the output directory
- get_filename_component(name ${output_file} NAME_WE)
- get_filename_component(OUTPUT_DIRECTORY ${output_file} PATH)
- set(OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/${name}_swig_docs)
- make_directory(${OUTPUT_DIRECTORY})
-
- #generate the Doxyfile used by doxygen
- configure_file(
- ${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.swig_doc.in
- ${OUTPUT_DIRECTORY}/Doxyfile
- @ONLY)
-
- #Create a dummy custom command that depends on other targets
- include(GrMiscUtils)
- GR_GEN_TARGET_DEPS(_${name}_tag tag_deps ${GR_SWIG_DOCS_TARGET_DEPS})
-
- #call doxygen on the Doxyfile + input headers
- add_custom_command(
- OUTPUT ${OUTPUT_DIRECTORY}/xml/index.xml
- DEPENDS ${input_files} ${GR_SWIG_DOCS_SOURCE_DEPS} ${tag_deps}
- COMMAND ${DOXYGEN_EXECUTABLE} ${OUTPUT_DIRECTORY}/Doxyfile
- COMMENT "Generating doxygen xml for ${name} docs"
- )
-
- #call the swig_doc script on the xml files
- add_custom_command(
- OUTPUT ${output_file}
- DEPENDS ${input_files} ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py
- ${OUTPUT_DIRECTORY}/xml
- ${output_file}
- COMMENT "Generating python docstrings for ${name}"
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/doxygen
- )
-
- else(ENABLE_DOXYGEN)
- file(WRITE ${output_file} "\n") #no doxygen -> empty file
- endif(ENABLE_DOXYGEN)
-endfunction(GR_SWIG_MAKE_DOCS)
-
-########################################################################
-# Build a swig target for the common gnuradio use case. Usage:
-# GR_SWIG_MAKE(target ifile ifile ifile...)
-#
-# Set the following variables before calling:
-# - GR_SWIG_FLAGS
-# - GR_SWIG_INCLUDE_DIRS
-# - GR_SWIG_LIBRARIES
-# - GR_SWIG_SOURCE_DEPS
-# - GR_SWIG_TARGET_DEPS
-# - GR_SWIG_DOC_FILE
-# - GR_SWIG_DOC_DIRS
-########################################################################
-macro(GR_SWIG_MAKE name)
- set(ifiles ${ARGN})
-
- # Shimming this in here to take care of a SWIG bug with handling
- # vector<size_t> and vector<unsigned int> (on 32-bit machines) and
- # vector<long unsigned int> (on 64-bit machines). Use this to test
- # the size of size_t, then set SIZE_T_32 if it's a 32-bit machine
- # or not if it's 64-bit. The logic in gr_type.i handles the rest.
- INCLUDE (CheckTypeSize)
- CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
- CHECK_TYPE_SIZE("unsigned int" SIZEOF_UINT)
- if(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_UINT})
- list(APPEND GR_SWIG_FLAGS -DSIZE_T_32)
- endif(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_UINT})
-
- #do swig doc generation if specified
- if (GR_SWIG_DOC_FILE)
- set(GR_SWIG_DOCS_SOURCE_DEPS ${GR_SWIG_SOURCE_DEPS})
- list(APPEND GR_SWIG_DOCS_TARGET_DEPS ${GR_SWIG_TARGET_DEPS})
- GR_SWIG_MAKE_DOCS(${GR_SWIG_DOC_FILE} ${GR_SWIG_DOC_DIRS})
- add_custom_target(${name}_swig_doc DEPENDS ${GR_SWIG_DOC_FILE})
- list(APPEND GR_SWIG_TARGET_DEPS ${name}_swig_doc ${GR_RUNTIME_SWIG_DOC_FILE})
- endif()
-
- #append additional include directories
- find_package(PythonLibs 2)
- list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) #deprecated name (now dirs)
- list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
-
- #prepend local swig directories
- list(INSERT GR_SWIG_INCLUDE_DIRS 0 ${CMAKE_CURRENT_SOURCE_DIR})
- list(INSERT GR_SWIG_INCLUDE_DIRS 0 ${CMAKE_CURRENT_BINARY_DIR})
-
- #determine include dependencies for swig file
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE}
- ${CMAKE_BINARY_DIR}/get_swig_deps.py
- "${ifiles}" "${GR_SWIG_INCLUDE_DIRS}"
- OUTPUT_STRIP_TRAILING_WHITESPACE
- OUTPUT_VARIABLE SWIG_MODULE_${name}_EXTRA_DEPS
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
- #Create a dummy custom command that depends on other targets
- include(GrMiscUtils)
- GR_GEN_TARGET_DEPS(_${name}_swig_tag tag_deps ${GR_SWIG_TARGET_DEPS})
- set(tag_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.tag)
- add_custom_command(
- OUTPUT ${tag_file}
- DEPENDS ${GR_SWIG_SOURCE_DEPS} ${tag_deps}
- COMMAND ${CMAKE_COMMAND} -E touch ${tag_file}
- )
-
- #append the specified include directories
- include_directories(${GR_SWIG_INCLUDE_DIRS})
- list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file})
-
- #setup the swig flags with flags and include directories
- set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
- foreach(dir ${GR_SWIG_INCLUDE_DIRS})
- list(APPEND CMAKE_SWIG_FLAGS "-I${dir}")
- endforeach(dir)
-
- #set the C++ property on the swig .i file so it builds
- set_source_files_properties(${ifiles} PROPERTIES CPLUSPLUS ON)
-
- #setup the actual swig library target to be built
- include(UseSWIG)
- SWIG_ADD_MODULE(${name} python ${ifiles})
- SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES})
-
-endmacro(GR_SWIG_MAKE)
-
-########################################################################
-# Install swig targets generated by GR_SWIG_MAKE. Usage:
-# GR_SWIG_INSTALL(
-# TARGETS target target target...
-# [DESTINATION destination]
-# [COMPONENT component]
-# )
-########################################################################
-macro(GR_SWIG_INSTALL)
-
- include(CMakeParseArgumentsCopy)
- CMAKE_PARSE_ARGUMENTS(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN})
-
- foreach(name ${GR_SWIG_INSTALL_TARGETS})
- install(TARGETS ${SWIG_MODULE_${name}_REAL_NAME}
- DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
- COMPONENT ${GR_SWIG_INSTALL_COMPONENT}
- )
-
- include(GrPython)
- GR_PYTHON_INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.py
- DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
- COMPONENT ${GR_SWIG_INSTALL_COMPONENT}
- )
-
- GR_LIBTOOL(
- TARGET ${SWIG_MODULE_${name}_REAL_NAME}
- DESTINATION ${GR_SWIG_INSTALL_DESTINATION}
- )
-
- endforeach(name)
-
-endmacro(GR_SWIG_INSTALL)
-
-########################################################################
-# Generate a python file that can determine swig dependencies.
-# Used by the make macro above to determine extra dependencies.
-# When you build C++, CMake figures out the header dependencies.
-# This code essentially performs that logic for swig includes.
-########################################################################
-file(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py "
-
-import os, sys, re
-
-i_include_matcher = re.compile('%(include|import)\\s*[<|\"](.*)[>|\"]')
-h_include_matcher = re.compile('#(include)\\s*[<|\"](.*)[>|\"]')
-include_dirs = sys.argv[2].split(';')
-
-def get_swig_incs(file_path):
- if file_path.endswith('.i'): matcher = i_include_matcher
- else: matcher = h_include_matcher
- file_contents = open(file_path, 'r').read()
- return matcher.findall(file_contents, re.MULTILINE)
-
-def get_swig_deps(file_path, level):
- deps = [file_path]
- if level == 0: return deps
- for keyword, inc_file in get_swig_incs(file_path):
- for inc_dir in include_dirs:
- inc_path = os.path.join(inc_dir, inc_file)
- if not os.path.exists(inc_path): continue
- deps.extend(get_swig_deps(inc_path, level-1))
- break #found, we dont search in lower prio inc dirs
- return deps
-
-if __name__ == '__main__':
- ifiles = sys.argv[1].split(';')
- deps = sum([get_swig_deps(ifile, 3) for ifile in ifiles], [])
- #sys.stderr.write(';'.join(set(deps)) + '\\n\\n')
- print(';'.join(set(deps)))
-")
diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake
deleted file mode 100644
index 62caab4..0000000
--- a/cmake/Modules/GrTest.cmake
+++ /dev/null
@@ -1,143 +0,0 @@
-# Copyright 2010-2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-if(DEFINED __INCLUDED_GR_TEST_CMAKE)
- return()
-endif()
-set(__INCLUDED_GR_TEST_CMAKE TRUE)
-
-########################################################################
-# Add a unit test and setup the environment for a unit test.
-# Takes the same arguments as the ADD_TEST function.
-#
-# Before calling set the following variables:
-# GR_TEST_TARGET_DEPS - built targets for the library path
-# GR_TEST_LIBRARY_DIRS - directories for the library path
-# GR_TEST_PYTHON_DIRS - directories for the python path
-# GR_TEST_ENVIRONS - other environment key/value pairs
-########################################################################
-function(GR_ADD_TEST test_name)
-
- #Ensure that the build exe also appears in the PATH.
- list(APPEND GR_TEST_TARGET_DEPS ${ARGN})
-
- #In the land of windows, all libraries must be in the PATH.
- #Since the dependent libraries are not yet installed,
- #we must manually set them in the PATH to run tests.
- #The following appends the path of a target dependency.
- foreach(target ${GR_TEST_TARGET_DEPS})
- get_target_property(location ${target} LOCATION)
- if(location)
- get_filename_component(path ${location} PATH)
- string(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path})
- list(APPEND GR_TEST_LIBRARY_DIRS ${path})
- endif(location)
- endforeach(target)
-
- if(WIN32)
- #SWIG generates the python library files into a subdirectory.
- #Therefore, we must append this subdirectory into PYTHONPATH.
- #Only do this for the python directories matching the following:
- foreach(pydir ${GR_TEST_PYTHON_DIRS})
- get_filename_component(name ${pydir} NAME)
- if(name MATCHES "^(swig|lib|src)$")
- list(APPEND GR_TEST_PYTHON_DIRS ${pydir}/${CMAKE_BUILD_TYPE})
- endif()
- endforeach(pydir)
- endif(WIN32)
-
- file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} srcdir)
- file(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list?
- file(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list?
-
- set(environs "VOLK_GENERIC=1" "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}")
- list(APPEND environs ${GR_TEST_ENVIRONS})
-
- #http://www.cmake.org/pipermail/cmake/2009-May/029464.html
- #Replaced this add test + set environs code with the shell script generation.
- #Its nicer to be able to manually run the shell script to diagnose problems.
- #ADD_TEST(${ARGV})
- #SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}")
-
- if(UNIX)
- set(LD_PATH_VAR "LD_LIBRARY_PATH")
- if(APPLE)
- set(LD_PATH_VAR "DYLD_LIBRARY_PATH")
- endif()
-
- set(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH")
- list(APPEND libpath "$${LD_PATH_VAR}")
- list(APPEND pypath "$PYTHONPATH")
-
- #replace list separator with the path separator
- string(REPLACE ";" ":" libpath "${libpath}")
- string(REPLACE ";" ":" pypath "${pypath}")
- list(APPEND environs "PATH=${binpath}" "${LD_PATH_VAR}=${libpath}" "PYTHONPATH=${pypath}")
-
- #generate a bat file that sets the environment and runs the test
- if (CMAKE_CROSSCOMPILING)
- set(SHELL "/bin/sh")
- else(CMAKE_CROSSCOMPILING)
- find_program(SHELL sh)
- endif(CMAKE_CROSSCOMPILING)
- set(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh)
- file(WRITE ${sh_file} "#!${SHELL}\n")
- #each line sets an environment variable
- foreach(environ ${environs})
- file(APPEND ${sh_file} "export ${environ}\n")
- endforeach(environ)
- #load the command to run with its arguments
- foreach(arg ${ARGN})
- file(APPEND ${sh_file} "${arg} ")
- endforeach(arg)
- file(APPEND ${sh_file} "\n")
-
- #make the shell file executable
- execute_process(COMMAND chmod +x ${sh_file})
-
- add_test(${test_name} ${SHELL} ${sh_file})
-
- endif(UNIX)
-
- if(WIN32)
- list(APPEND libpath ${DLL_PATHS} "%PATH%")
- list(APPEND pypath "%PYTHONPATH%")
-
- #replace list separator with the path separator (escaped)
- string(REPLACE ";" "\\;" libpath "${libpath}")
- string(REPLACE ";" "\\;" pypath "${pypath}")
- list(APPEND environs "PATH=${libpath}" "PYTHONPATH=${pypath}")
-
- #generate a bat file that sets the environment and runs the test
- set(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat)
- file(WRITE ${bat_file} "@echo off\n")
- #each line sets an environment variable
- foreach(environ ${environs})
- file(APPEND ${bat_file} "SET ${environ}\n")
- endforeach(environ)
- #load the command to run with its arguments
- foreach(arg ${ARGN})
- file(APPEND ${bat_file} "${arg} ")
- endforeach(arg)
- file(APPEND ${bat_file} "\n")
-
- add_test(${test_name} ${bat_file})
- endif(WIN32)
-
-endfunction(GR_ADD_TEST)
diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake
deleted file mode 100644
index bafd0a7..0000000
--- a/cmake/Modules/GrVersion.cmake
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 2011,2013 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-if(DEFINED __INCLUDED_GR_VERSION_CMAKE)
- return()
-endif()
-set(__INCLUDED_GR_VERSION_CMAKE TRUE)
-
-#eventually, replace version.sh and fill in the variables below
-set(MAJOR_VERSION ${VERSION_INFO_MAJOR_VERSION})
-set(API_COMPAT ${VERSION_INFO_API_COMPAT})
-set(MINOR_VERSION ${VERSION_INFO_MINOR_VERSION})
-set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION})
-
-########################################################################
-# Extract the version string from git describe.
-########################################################################
-find_package(Git)
-
-if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
- message(STATUS "Extracting version information from git describe...")
- execute_process(
- COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long
- OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- )
-else()
- set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown")
-endif()
-
-########################################################################
-# Use the logic below to set the version constants
-########################################################################
-if("${MINOR_VERSION}" STREQUAL "git")
- # VERSION: 3.3git-xxx-gxxxxxxxx
- # DOCVER: 3.3git
- # LIBVER: 3.3git
- set(VERSION "${GIT_DESCRIBE}")
- set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}")
- set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}")
- set(RC_MINOR_VERSION "0")
- set(RC_MAINT_VERSION "0")
-elseif("${MAINT_VERSION}" STREQUAL "git")
- # VERSION: 3.3.1git-xxx-gxxxxxxxx
- # DOCVER: 3.3.1git
- # LIBVER: 3.3.1git
- set(VERSION "${GIT_DESCRIBE}")
- set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}")
- set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}")
- math(EXPR RC_MINOR_VERSION "${MINOR_VERSION} - 1")
- set(RC_MAINT_VERSION "0")
-else()
- # This is a numbered release.
- # VERSION: 3.3.1{.x}
- # DOCVER: 3.3.1{.x}
- # LIBVER: 3.3.1{.x}
- if("${MAINT_VERSION}" STREQUAL "0")
- set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}")
- else()
- set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}.${MAINT_VERSION}")
- endif()
- set(DOCVER "${VERSION}")
- set(LIBVER "${VERSION}")
- set(RC_MINOR_VERSION ${MINOR_VERSION})
- set(RC_MAINT_VERSION ${MAINT_VERSION})
-endif()
diff --git a/cmake/Modules/targetConfig.cmake.in b/cmake/Modules/targetConfig.cmake.in
new file mode 100644
index 0000000..79e4a28
--- /dev/null
+++ b/cmake/Modules/targetConfig.cmake.in
@@ -0,0 +1,26 @@
+# Copyright 2018 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio 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, or (at your option)
+# any later version.
+#
+# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+include(CMakeFindDependencyMacro)
+
+set(target_deps "@TARGET_DEPENDENCIES@")
+foreach(dep IN LISTS target_deps)
+ find_dependency(${dep})
+endforeach()
+include("${CMAKE_CURRENT_LIST_DIR}/@TARGET@Targets.cmake")
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..029e9c8
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,188 @@
+gr-osmosdr (0.1.5git) unstable; urgency=medium
+
+ * Add initial support for Airspy HF+
+ * Support for FreeSRP via libfreesrp
+
+ -- Harald Welte <laforge@gnumonks.org> Sun, 03 Jun 2018 10:38:52 +0200
+
+gr-osmosdr (0.1.4-14) unstable; urgency=medium
+
+ * Add initial support for Airspy HF+
+ * Support for FreeSRP via libfreesrp
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Thu, 23 Nov 2017 10:38:52 -0500
+
+gr-osmosdr (0.1.4-13) unstable; urgency=medium
+
+ * update to v0.1.4-98-gc653754
+ * rtl-sdr bias-T support
+ * build with gnuradio-3.7.11
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Thu, 07 Sep 2017 19:50:05 -0400
+
+gr-osmosdr (0.1.4-12) unstable; urgency=medium
+
+ * rebuild with airspy-host 1.0.9
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Fri, 14 Oct 2016 20:58:28 -0400
+
+gr-osmosdr (0.1.4-11) unstable; urgency=medium
+
+ * Add SoapySDR support
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Sun, 28 Aug 2016 14:52:53 -0400
+
+gr-osmosdr (0.1.4-10) unstable; urgency=medium
+
+ * build with gnuradio-3.7.10
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Sun, 10 Jul 2016 12:41:34 -0400
+
+gr-osmosdr (0.1.4-9) unstable; urgency=medium
+
+ * update to v0.1.4-72-g164a09f
+ * rebuild on kfreebsd (Closes: #822132)
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Fri, 29 Apr 2016 05:10:35 -0400
+
+gr-osmosdr (0.1.4-8) unstable; urgency=medium
+
+ * update to v0.1.4-67-gac15e78, build with gnuradio 3.7.9
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Wed, 13 Jan 2016 00:16:06 -0500
+
+gr-osmosdr (0.1.4-7) unstable; urgency=medium
+
+ * Lintian cleanups pre-depends and dep5-copyright
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Sat, 28 Nov 2015 22:57:30 -0500
+
+gr-osmosdr (0.1.4-6) unstable; urgency=medium
+
+ * Don't depend upon hackrf on non-linux
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Mon, 05 Oct 2015 00:25:01 -0400
+
+gr-osmosdr (0.1.4-5) unstable; urgency=medium
+
+ * Rebuild with uhd 3.9.1-3
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Wed, 30 Sep 2015 21:06:49 -0400
+
+gr-osmosdr (0.1.4-4) unstable; urgency=medium
+
+ * Tighten libuhd003 versioned dependency via dh_makeshlibs
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Wed, 30 Sep 2015 01:04:40 -0400
+
+gr-osmosdr (0.1.4-3) unstable; urgency=low
+
+ * rebuild with uhd-3.9.1
+ * post gcc-5 libstdc++6 transition build (Closes: #791062)
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Mon, 14 Sep 2015 20:51:16 -0400
+
+gr-osmosdr (0.1.4-2) unstable; urgency=medium
+
+ * add watch file, rebuild with uhd-3.9.0
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Thu, 10 Sep 2015 10:55:58 -0400
+
+gr-osmosdr (0.1.4-1) unstable; urgency=medium
+
+ * New upstream, update to v0.1.4-48-g86ad584
+ build with gnuradio 3.7.8
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Sun, 16 Aug 2015 21:55:38 -0400
+
+gr-osmosdr (0.1.3-2) unstable; urgency=low
+
+ * Add versioned depends for bladerf (Closes: #759927)
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Wed, 10 Sep 2014 23:57:56 -0400
+
+gr-osmosdr (0.1.3-1) unstable; urgency=low
+
+ * New upstream release
+ * build with gnuradio 3.7.5
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Wed, 03 Sep 2014 22:21:12 -0400
+
+gr-osmosdr (0.1.2-1) unstable; urgency=low
+
+ * New upstream release, update to v0.1.2-2-g8604d76
+ * Include airspy support
+ * pkg-gr-osmosdr git for Debian packaging (Closes: #759268)
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Thu, 28 Aug 2014 14:37:08 -0400
+
+gr-osmosdr (0.1.1.4.ac95af2-1) unstable; urgency=low
+
+ * Update to v0.1.1-4-gac95af2
+ reverting 66109099 rtl: implement methods allowing runtime to control
+ sampling process
+ * Build with gnuradio 3.7.3 (Closes: #743392)
+ * Osmocom MiriSDR support
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Sat, 19 Apr 2014 19:22:49 -0400
+
+gr-osmosdr (0.1.0.55.80c4af-2~bpo70~1) wheezy-backports; urgency=low
+
+ * Rebuild for wheezy-backports.
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Tue, 11 Feb 2014 16:57:11 -0500
+
+gr-osmosdr (0.1.0.55.80c4af-2) unstable; urgency=low
+
+ * ship grc blocks
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Fri, 03 Jan 2014 00:32:28 -0500
+
+gr-osmosdr (0.1.0.55.80c4af-1) unstable; urgency=low
+
+ * New upstream commit, build with gnuradio 3.7.2.1
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Tue, 31 Dec 2013 00:09:54 -0500
+
+gr-osmosdr (0.1.0.11.04b4c8-3) unstable; urgency=low
+
+ * Fix up dependencies for current unstable build
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Thu, 12 Dec 2013 12:05:35 -0500
+
+gr-osmosdr (0.1.0.11.04b4c8-2) unstable; urgency=low
+
+ * drop bladerf dependency
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Sat, 23 Nov 2013 11:25:21 -0500
+
+gr-osmosdr (0.1.0.11.04b4c8-1) unstable; urgency=low
+
+ * New upstream snapshot (Closes: #726469)
+ * Match GNU Radio live distribution version
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Tue, 08 Oct 2013 17:30:31 -0400
+
+gr-osmosdr (0.1git59ceddb-1) unstable; urgency=low
+
+ * New upstream release, build with gnuradio 3.6.4.1-0wheezy1
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Wed, 01 May 2013 17:19:35 -0400
+
+gr-osmosdr (0.1gitd11b7a-1) unstable; urgency=low
+
+ * New upstream git, build with gnuradio 3.6.3
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Wed, 13 Feb 2013 15:56:33 -0500
+
+gr-osmosdr (0.1git0f25dae-1) unstable; urgency=low
+
+ * New upstream git, build with gnuradio 3.6.2
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Sun, 16 Sep 2012 20:47:39 -0400
+
+gr-osmosdr (0.0git7f796fe-1) unstable; urgency=low
+
+ * New upstream git, build with gnuradio 3.6.0
+
+ -- A. Maitland Bottoms <bottoms@debian.org> Mon, 14 May 2012 20:28:18 -0400
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..6291417
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,79 @@
+Source: gr-osmosdr
+Section: libdevel
+Priority: optional
+Maintainer: Harald Welte <laforge@gnumonks.org>
+Build-Depends: cmake,
+ debhelper (>= 9.0.0~),
+ dh-python,
+ doxygen,
+ gnuradio-dev (>=3.7.11),
+ gr-fcdproplus (>=3.7.25.4b6464b-3) [!hurd-i386],
+ gr-iqbal (>=0.37.2-8),
+ libairspy-dev (>= 1.0.9~) [!hurd-i386],
+ libairspyhf-dev [!hurd-i386],
+ libbladerf-dev (>=0.2016.01~rc1) [!hurd-i386],
+ libboost-dev,
+ libboost-system-dev,
+ libboost-thread-dev,
+ libfreesrp-dev [!hurd-i386],
+ libhackrf-dev [linux-any],
+ liblog4cpp5-dev,
+ libmirisdr-dev [!hurd-i386],
+ libosmosdr-dev [!hurd-i386],
+ librtlsdr-dev [!hurd-i386],
+ libsoapysdr-dev,
+ libuhd-dev (>=3.10),
+ pkg-config,
+ python-dev,
+ python-soapysdr,
+ swig
+X-Python-Version: >= 2.7, << 2.8
+Standards-Version: 4.1.0
+Homepage: https://osmocom.org/projects/gr-osmosdr/wiki
+Vcs-Git: https://gitea.osmocom.org/sdr/gr-osmosdr
+Vcs-Browser: https://gitea.osmocom.org/sdr/gr-osmosdr
+
+Package: gr-osmosdr
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
+Recommends: gnuradio, gr-fosphor
+Description: Gnuradio blocks from the OsmoSDR project
+ The Osmocom project is a family of projects regarding Open source
+ mobile communications.
+ .
+ While primarily being developed for the OsmoSDR hardware, this block
+ as well supports:
+ - FUNcube Dongle through libgnuradio-fcd
+ - FUNcube Dongle Pro+ through gr-fcdproplus
+ - sysmocom OsmoSDR Devices through libosmosdr
+ - RTL2832U based DVB-T dongles through librtlsdr
+ - RTL-TCP spectrum server (see librtlsdr project)
+ - MSi2500 based DVB-T dongles through libmirisdr
+ - gnuradio .cfile input through libgnuradio-blocks
+ - RFSPACE SDR-IQ, SDR-IP, NetSDR (incl. X2 option)
+ - Great Scott Gadgets HackRF through libhackrf
+ - Nuand LLC bladeRF through libbladeRF library
+ - Ettus USRP Devices through Ettus UHD library
+ - Fairwaves UmTRX through Fairwaves' fork of UHD
+ - AIRSPY Receiver
+ - AIRSPY HF+ Receiver
+ - SoapySDR support
+ - Red Pitaya SDR transceiver (http://bazaar.redpitaya.com)
+ - FreeSRP through libfreesrp
+ .
+ By using the OsmoSDR block you can take advantage of a common
+ software API in your application(s) independent of the underlying
+ radio hardware.
+
+Package: libgnuradio-osmosdr0.1.4
+Section: libs
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Multi-Arch: same
+Description: Gnuradio blocks from the OsmoSDR project - library
+ The Osmocom project is a family of projects regarding Open source
+ mobile communications.
+ .
+ This package contains the shared library.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..a23bb61
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,195 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: gr-osmosdr
+Upstream-Contact: http://sdr.osmocom.org/trac/wiki/rtl-sdr
+Source:
+ git clone https://gitea.osmocom.org/sdr/gr-osmosdr
+ The upstream package source tarball was generated from the tag:
+ git archive --format=tar --prefix=gr-osmosdr-0.1.4/ v0.1.4 | xz > ../gr-osmosdr_0.1.4.orig.tar.xz
+Comment:
+ Debian packages by A. Maitland Bottoms <bottoms@debian.org>,
+ .
+ Upstream Author:
+ Dimitri Stolnikov <horiz0n@gmx.net>
+Copyright: 2012,2013 Dimitri Stolnikov <horiz0n@gmx.net>
+License: GPL-3+
+
+Files: COPYING
+Copyright: 2007 Free Software Foundation, Inc. <http://fsf.org/>
+License: FSF-COPYING
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Files: CMakeLists.txt apps/* docs/* python/* include/osmosdr/api.h
+ cmake/Modules/* include/osmosdr/CMakeLists.txt
+ lib/CMakeLists.txt lib/gnuradio-osmosdr.rc.in
+ lib/bladerf/CMakeLists.txt swig/* grc/CMakeLists.txt
+Copyright: 2005,2007-2013 Free Software Foundation, Inc.
+Comment: GNU Radio gr_modtool derived
+License: GPL-3+
+
+Files: debian/*
+Copyright: 2013 A. Maitland Bottoms <bottoms@debian.org>
+License: GPL-3+
+
+Files: grc/gen_osmosdr_blocks.py
+Copyright: 2012 Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: include/osmosdr/pimpl.h include/osmosdr/ranges.h lib/ranges.cc
+ include/osmosdr/time_spec.h lib/time_spec.cc
+Copyright: 2010-2013 Ettus Research LLC
+License: GPL-3+
+
+FIles: lib/bladerf/bladerf_common.cc lib/bladerf/bladerf_common.h
+ lib/bladerf/bladerf_sink_c.cc lib/bladerf/bladerf_sink_c.h
+ lib/bladerf/bladerf_source_c.cc lib/bladerf/bladerf_source_c.h
+Copyright: 2013 Nuand LLC
+ 2013 Dimitri Stolnikov <horiz0n@gmx.net>
+License: GPL-3+
+
+Files: lib/soapy/*
+Copyright: 2015 Josh Blum <josh@joshknows.com>
+ 2013 Dimitri Stolnikov <horiz0n@gmx.net>
+License: GPL-3+
+
+Files: lib/freesrp/*
+Copyright: 2017 by Lukas Lao Beyer
+License: GPL-3+
+
+Files: AUTHORS MANIFEST.md README.md gnuradio-osmosdr.pc.in
+ cmake/cmake_uninstall.cmake.in include/osmosdr/device.h
+ include/osmosdr/sink.h include/osmosdr/source.h
+ lib/arg_helpers.h lib/config.h.in lib/device.cc
+ lib/sink_iface.h lib/sink_impl.cc lib/sink_impl.h
+ lib/source_iface.h lib/source_impl.cc lib/source_impl.h
+ lib/airspy/* lib/fcd/* lib/file/* lib/hackrf/*
+ lib/miri/* lib/osmosdr/* lib/rfspace/* lib/rtl*
+ lib/sdrplay/* lib/uhd/*
+Copyright: 2012-2013 Dimitri Stolnikov <horiz0n@gmx.net>
+License: GPL-3+
+
+Files: lib/rtl_tcp/rtl_tcp_source_f.h
+Copyright: 2012 Hoernchen <la@tfc-server.de>
+License: GPL-3+
+
+Files: lib/miri/miri_source_c.cc
+Copyright: 2012 Steve Markgraf <steve@steve-m.de>
+ 2012 Dimitri Stolnikov <horiz0n@gmx.net>
+License: GPL-3+
+
+Files: lib/redpitaya/*
+Copyright: 2015 Pavel Demin
+ 2012,2015 Dimitri Stolnikov <horiz0n@gmx.net>
+License: GPL-3+
+
+Files: lib/freesrp/readerwriterqueue/*
+Copyright: 2013-2015, Cameron Desrochers
+Comment: libfreesrp includes ReaderWriterQueue
+License: Simplified-BSD
+ All rights reserved.
+ .
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+ .
+ - Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright notice, this list of
+ conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: lib/freesrp/readerwriterqueue/atomicops.h
+Copyright: 2015 Jeff Preshing
+License: atomicops
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgement in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+Files: cmake/Modules/CMakeParseArgumentsCopy.cmake
+Copyright: 2010 Alexander Neundorf <neundorf@kde.org>
+Comment: copy of CMakeParseArguments.cmake from cmake 2.8.x
+License: Kitware-BSD
+ All rights reserved.
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ .
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ .
+ * Neither the names of Kitware, Inc., the Insight Software Consortium,
+ nor the names of their contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: GPL-2+
+ GNU Radio Companion 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 2
+ of the License, or (at your option) any later version.
+ .
+ GNU Radio Companion 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ .
+ On Debian systems, the complete text of the GNU General Public
+ License (GPL) version 3 can be found in the file
+ '/usr/share/common-licenses/GPL-2'.
+
+License: GPL-3+
+ GNU Radio 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, or (at your option)
+ any later version.
+ .
+ GNU Radio 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.
+ .
+ On Debian systems, the complete text of the GNU General Public
+ License (GPL) version 3 can be found in the file
+ '/usr/share/common-licenses/GPL-3'.
diff --git a/debian/gr-osmosdr.install b/debian/gr-osmosdr.install
new file mode 100644
index 0000000..3434eae
--- /dev/null
+++ b/debian/gr-osmosdr.install
@@ -0,0 +1,6 @@
+usr/bin/*
+usr/include/*
+usr/lib/*/lib*.so
+usr/lib/*/pkgconfig/*
+usr/lib/python*
+usr/share/*
diff --git a/debian/gr-osmosdr.manpages b/debian/gr-osmosdr.manpages
new file mode 100644
index 0000000..ee5ccbe
--- /dev/null
+++ b/debian/gr-osmosdr.manpages
@@ -0,0 +1,4 @@
+debian/osmocom_fft.1
+debian/osmocom_siggen.1
+debian/osmocom_siggen_nogui.1
+debian/osmocom_spectrum_sense.1
diff --git a/debian/libgnuradio-osmosdr0.1.4.install b/debian/libgnuradio-osmosdr0.1.4.install
new file mode 100644
index 0000000..3ddde58
--- /dev/null
+++ b/debian/libgnuradio-osmosdr0.1.4.install
@@ -0,0 +1 @@
+usr/lib/*/lib*.so.*
diff --git a/debian/osmocom_fft.1 b/debian/osmocom_fft.1
new file mode 100644
index 0000000..0b24d71
--- /dev/null
+++ b/debian/osmocom_fft.1
@@ -0,0 +1,224 @@
+.TH osmocom_fft "1" "October 2013" "OSMOCOM" "User Commands"
+.SH NAME
+osmocom_fft \- Spectrum Browser
+.SH SYNOPSIS
+.B osmocom_fft
+[\fIoptions\fR]
+.SH DESCRIPTION
+Spectrum Browser
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit
+.TP
+\fB\-a\fR ARGS, \fB\-\-args\fR=\fIARGS\fR
+Device args, [default=]
+.TP
+\fB\-A\fR ANTENNA, \fB\-\-antenna\fR=\fIANTENNA\fR
+Select RX antenna where appropriate
+.TP
+\fB\-s\fR SAMP_RATE, \fB\-\-samp\-rate\fR=\fISAMP_RATE\fR
+Set sample rate (bandwidth), minimum by default
+.TP
+\fB\-f\fR FREQ, \fB\-\-center\-freq\fR=\fIFREQ\fR
+Set frequency to FREQ
+.TP
+\fB\-c\fR FREQ_CORR, \fB\-\-freq\-corr\fR=\fIFREQ_CORR\fR
+Set frequency correction (ppm)
+.TP
+\fB\-g\fR GAIN, \fB\-\-gain\fR=\fIGAIN\fR
+Set gain in dB (default is midpoint)
+.TP
+\fB\-W\fR, \fB\-\-waterfall\fR
+Enable waterfall display
+.TP
+\fB\-S\fR, \fB\-\-oscilloscope\fR
+Enable oscilloscope display
+.TP
+\fB\-\-avg\-alpha\fR=\fIAVG_ALPHA\fR
+Set fftsink averaging factor, default=[0.1]
+.TP
+\fB\-\-averaging\fR
+Enable fftsink averaging, default=[False]
+.TP
+\fB\-\-ref\-scale\fR=\fIREF_SCALE\fR
+Set dBFS=0dB input value, default=[1.0]
+.TP
+\fB\-\-fft\-size\fR=\fIFFT_SIZE\fR
+Set number of FFT bins [default=1024]
+.TP
+\fB\-\-fft\-rate\fR=\fIFFT_RATE\fR
+Set FFT update rate, [default=30]
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Use verbose console output [default=False]
+.SH "SEE ALSO"
+The full documentation for
+.B linux;
+is maintained as a Texinfo manual. If the
+.B info
+and
+.B linux;
+programs are properly installed at your site, the command
+.IP
+.B info linux;
+.PP
+should give you access to the complete manual.
+.SH Device specification
+You can specify the source or sink device using a comma separated string of argument=value pairs. The always-up-to-date block documentation with examples is available ​right here.
+.SH FCD Source
+.TP
+Argument
+Notes
+.TP
+fcd=<device-index>
+0-based device identifier, optional
+.TP
+device=hw:2
+overrides the audio device
+.TP
+type=2
+selects the dongle type, 1 for Classic, 2 for Pro+
+.LP
+The "device" argument overrides the audio device used by the underlying driver to access the dongle's IQ sample stream.
+.LP
+The "type" argument selects the dongle type, 1 for Classic, 2 for Pro+.
+.SH OsmoSDR Source
+.TP
+Argument
+Notes
+.TP
+osmosdr=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.SH RTL-SDR Source
+.TP
+Argument
+Notes
+.TP
+rtl=<device-index>
+0-based device identifier OR serial number
+.TP
+rtl_xtal=<frequency>
+Frequency (Hz) used for the RTL chip, accepts eng notation
+.TP
+tuner_xtal=<frequency>
+Frequency (Hz) used for the tuner chip, accepts eng notation
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip. 0: Disable, 1: use I channel, 2: use Q channel
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.LP
+NOTE: use rtl_eeprom -s to program your own serial number to the device
+.LP
+NOTE: if you don't specify rtl_xtal/tuner_xtal, the underlying driver will use 28.0MHz
+.SH RTL-SDR TCP Source
+.TP
+Argument
+Notes
+.TP
+rtl_tcp=<hostname>:<port>
+hostname defaults to "localhost", port to "1234"
+.TP
+psize=<payload-size>
+Default is 16384 bytes
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip 0=Off, 1=I-ADC input enabled, 2=Q-ADC input enabled
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.SH Miri Source
+.TP
+Argument
+Notes
+.TP
+miri=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.SH UHD Source / Sink
+Argument
+Notes
+.TP
+uhd
+Use this argument without a value
+.TP
+nchan=<channel-count>
+For multichannel USRP configurations use the subdev parameter to specify stream mapping
+.TP
+subdev=<subdev-spec>
+Examples: "A:0", "B:0", "A:0 B:0" when nchan=2. Refer original ettus documentation on this
+.TP
+lo_offset=<frequency>
+Offset frequency in Hz, must be within daughterboard bandwidth. Accepts eng notation
+.LP
+Additional argument/value pairs will be passed to the underlying driver, for more information see ​specifying the subdevice and ​common device identifiers in the Ettus documentation.
+.SH bladeRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+bladerf[=0]
+0-based device identifier (optional)
+.TP
+fw='/path/to/the/firmware.img'
+program MCU firmware from given file. usually not needed. power cycle required.
+.TP
+fpga='/path/to/the/bitstream.rbf'
+load FPGA bitstream from given file. required only at first run at the moment.
+.SH HackRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+hackrf
+Use this argument without a value
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.LP
+Only the first device found may be used at the moment because of libhackrf limitation.
+.LP
+Transmit support has been verified by using the crc-mmbTools DAB sdr transmitter.
+.SH IQ File Source
+.TP
+Argument
+Notes
+.TP
+file=<path-to-file-name>
+.TP
+freq=<frequency>
+Center frequency in Hz, accepts eng notation
+.TP
+rate=<sampling-rate>
+Mandatory, in samples/s, accepts eng notation
+.TP
+repeat=true|false
+Default is true
+.TP
+throttle=true|false
+Throttle flow of samples, default is true
+.SH EXAMPLES
+.LP
+osmocom_fft -a rtl=0 -v -f 100e6 -s 2.4e6 -g 15
+.LP
+osmocom_fft -a hackrf -v
+.LP
+osmocom_fft -a uhd -v
+.SH "SEE ALSO"
+osmocom_siggen(1) osmocom_siggen_nogui(1) osmocom_spectrum_sense(1)
diff --git a/debian/osmocom_siggen.1 b/debian/osmocom_siggen.1
new file mode 100644
index 0000000..d9d9d47
--- /dev/null
+++ b/debian/osmocom_siggen.1
@@ -0,0 +1,222 @@
+.TH osmocom_siggen "1" "October 2013" "OSMOCOM" "User Commands"
+.SH NAME
+osmocom_siggen \- Signal Generator Application with GUI controls
+.SH SYNOPSIS
+.B osmocom_siggen:
+[\fIoptions\fR]
+.SH DESCRIPTION
+Signal Generator Application with GUI controls
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit
+.TP
+\fB\-a\fR ARGS, \fB\-\-args\fR=\fIARGS\fR
+Device args, [default=]
+.TP
+\fB\-A\fR ANTENNA, \fB\-\-antenna\fR=\fIANTENNA\fR
+Select Rx Antenna where appropriate
+.TP
+\fB\-s\fR SAMP_RATE, \fB\-\-samp\-rate\fR=\fISAMP_RATE\fR
+Set sample rate (bandwidth), minimum by default
+.TP
+\fB\-g\fR GAIN, \fB\-\-gain\fR=\fIGAIN\fR
+Set gain in dB (default is midpoint)
+.TP
+\fB\-f\fR FREQ, \fB\-\-tx\-freq\fR=\fIFREQ\fR
+Set carrier frequency to FREQ [default=mid\-point]
+.TP
+\fB\-c\fR FREQ_CORR, \fB\-\-freq\-corr\fR=\fIFREQ_CORR\fR
+Set carrier frequency correction [default=0]
+.TP
+\fB\-x\fR WAVEFORM_FREQ, \fB\-\-waveform\-freq\fR=\fIWAVEFORM_FREQ\fR
+Set baseband waveform frequency to FREQ [default=0]
+.TP
+\fB\-y\fR WAVEFORM2_FREQ, \fB\-\-waveform2\-freq\fR=\fIWAVEFORM2_FREQ\fR
+Set 2nd waveform frequency to FREQ [default=none]
+.TP
+\fB\-\-sine\fR
+Generate a carrier modulated by a complex sine wave
+.TP
+\fB\-\-const\fR
+Generate a constant carrier
+.TP
+\fB\-\-offset\fR=\fIOFFSET\fR
+Set waveform phase offset to OFFSET [default=0]
+.TP
+\fB\-\-gaussian\fR
+Generate Gaussian random output
+.TP
+\fB\-\-uniform\fR
+Generate Uniform random output
+.TP
+\fB\-\-2tone\fR
+Generate Two Tone signal for IMD testing
+.TP
+\fB\-\-sweep\fR
+Generate a swept sine wave
+.TP
+\fB\-\-gsm\fR
+Generate GMSK modulated GSM Burst Sequence
+.TP
+\fB\-\-amplitude\fR=\fIAMPL\fR
+Set output amplitude to AMPL (0.1\-1.0) [default=0.3]
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Use verbose console output [default=False]
+.SH Device specification
+You can specify the source or sink device using a comma separated string of argument=value pairs. The always-up-to-date block documentation with examples is available ​right here.
+.SH FCD Source
+.TP
+Argument
+Notes
+.TP
+fcd=<device-index>
+0-based device identifier, optional
+.TP
+device=hw:2
+overrides the audio device
+.TP
+type=2
+selects the dongle type, 1 for Classic, 2 for Pro+
+.LP
+The "device" argument overrides the audio device used by the underlying driver to access the dongle's IQ sample stream.
+.LP
+The "type" argument selects the dongle type, 1 for Classic, 2 for Pro+.
+.SH OsmoSDR Source
+.TP
+Argument
+Notes
+.TP
+osmosdr=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.SH RTL-SDR Source
+.TP
+Argument
+Notes
+.TP
+rtl=<device-index>
+0-based device identifier OR serial number
+.TP
+rtl_xtal=<frequency>
+Frequency (Hz) used for the RTL chip, accepts eng notation
+.TP
+tuner_xtal=<frequency>
+Frequency (Hz) used for the tuner chip, accepts eng notation
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip. 0: Disable, 1: use I channel, 2: use Q channel
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.LP
+NOTE: use rtl_eeprom -s to program your own serial number to the device
+.LP
+NOTE: if you don't specify rtl_xtal/tuner_xtal, the underlying driver will use 28.0MHz
+.SH RTL-SDR TCP Source
+.TP
+Argument
+Notes
+.TP
+rtl_tcp=<hostname>:<port>
+hostname defaults to "localhost", port to "1234"
+.TP
+psize=<payload-size>
+Default is 16384 bytes
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip 0=Off, 1=I-ADC input enabled, 2=Q-ADC input enabled
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.SH Miri Source
+.TP
+Argument
+Notes
+.TP
+miri=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.SH UHD Source / Sink
+Argument
+Notes
+.TP
+uhd
+Use this argument without a value
+.TP
+nchan=<channel-count>
+For multichannel USRP configurations use the subdev parameter to specify stream mapping
+.TP
+subdev=<subdev-spec>
+Examples: "A:0", "B:0", "A:0 B:0" when nchan=2. Refer original ettus documentation on this
+.TP
+lo_offset=<frequency>
+Offset frequency in Hz, must be within daughterboard bandwidth. Accepts eng notation
+.LP
+Additional argument/value pairs will be passed to the underlying driver, for more information see ​specifying the subdevice and ​common device identifiers in the Ettus documentation.
+.SH bladeRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+bladerf[=0]
+0-based device identifier (optional)
+.TP
+fw='/path/to/the/firmware.img'
+program MCU firmware from given file. usually not needed. power cycle required.
+.TP
+fpga='/path/to/the/bitstream.rbf'
+load FPGA bitstream from given file. required only at first run at the moment.
+.SH HackRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+hackrf
+Use this argument without a value
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.LP
+Only the first device found may be used at the moment because of libhackrf limitation.
+.LP
+Transmit support has been verified by using the crc-mmbTools DAB sdr transmitter.
+.SH IQ File Source
+.TP
+Argument
+Notes
+.TP
+file=<path-to-file-name>
+.TP
+freq=<frequency>
+Center frequency in Hz, accepts eng notation
+.TP
+rate=<sampling-rate>
+Mandatory, in samples/s, accepts eng notation
+.TP
+repeat=true|false
+Default is true
+.TP
+throttle=true|false
+Throttle flow of samples, default is true
+.SH EXAMPLES
+.LP
+osmocom_siggen -a hackrf -f 100e6 --sine
+.LP
+osmocom_siggen -a hackrf -f 100e6 --sweep -x 2M -y 1 -c34
+.SH "SEE ALSO"
+osmocom_fft(1) osmocom_siggen(1) osmocom_spectrum_sense(1)
diff --git a/debian/osmocom_siggen_nogui.1 b/debian/osmocom_siggen_nogui.1
new file mode 100644
index 0000000..0228ad5
--- /dev/null
+++ b/debian/osmocom_siggen_nogui.1
@@ -0,0 +1,224 @@
+.TH osmocom_siggen_nogui "1" "October 2013" "OSMOCOM" "User Commands"
+.SH NAME
+osmocom_siggen_nogui \- Signal generator application
+.SH SYNOPSIS
+.B osmocom_siggen_nogui:
+[\fIoptions\fR]
+.SH DESCRIPTION
+Signal generator application
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit
+.TP
+\fB\-a\fR ARGS, \fB\-\-args\fR=\fIARGS\fR
+Device args, [default=]
+.TP
+\fB\-A\fR ANTENNA, \fB\-\-antenna\fR=\fIANTENNA\fR
+Select Rx Antenna where appropriate
+.TP
+\fB\-s\fR SAMP_RATE, \fB\-\-samp\-rate\fR=\fISAMP_RATE\fR
+Set sample rate (bandwidth), minimum by default
+.TP
+\fB\-g\fR GAIN, \fB\-\-gain\fR=\fIGAIN\fR
+Set gain in dB (default is midpoint)
+.TP
+\fB\-f\fR FREQ, \fB\-\-tx\-freq\fR=\fIFREQ\fR
+Set carrier frequency to FREQ [default=mid\-point]
+.TP
+\fB\-c\fR FREQ_CORR, \fB\-\-freq\-corr\fR=\fIFREQ_CORR\fR
+Set carrier frequency correction [default=0]
+.TP
+\fB\-x\fR WAVEFORM_FREQ, \fB\-\-waveform\-freq\fR=\fIWAVEFORM_FREQ\fR
+Set baseband waveform frequency to FREQ [default=0]
+.TP
+\fB\-y\fR WAVEFORM2_FREQ, \fB\-\-waveform2\-freq\fR=\fIWAVEFORM2_FREQ\fR
+Set 2nd waveform frequency to FREQ [default=none]
+.TP
+\fB\-\-sine\fR
+Generate a carrier modulated by a complex sine wave
+.TP
+\fB\-\-const\fR
+Generate a constant carrier
+.TP
+\fB\-\-offset\fR=\fIOFFSET\fR
+Set waveform phase offset to OFFSET [default=0]
+.TP
+\fB\-\-gaussian\fR
+Generate Gaussian random output
+.TP
+\fB\-\-uniform\fR
+Generate Uniform random output
+.TP
+\fB\-\-2tone\fR
+Generate Two Tone signal for IMD testing
+.TP
+\fB\-\-sweep\fR
+Generate a swept sine wave
+.TP
+\fB\-\-gsm\fR
+Generate GMSK modulated GSM Burst Sequence
+.TP
+\fB\-\-amplitude\fR=\fIAMPL\fR
+Set output amplitude to AMPL (0.1\-1.0) [default=0.3]
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Use verbose console output [default=False]
+.PP
+Note: failed to enable realtime scheduling, continuing
+.SH Device specification
+You can specify the source or sink device using a comma separated string of argument=value pairs. The always-up-to-date block documentation with examples is available ​right here.
+.SH FCD Source
+.TP
+Argument
+Notes
+.TP
+fcd=<device-index>
+0-based device identifier, optional
+.TP
+device=hw:2
+overrides the audio device
+.TP
+type=2
+selects the dongle type, 1 for Classic, 2 for Pro+
+.LP
+The "device" argument overrides the audio device used by the underlying driver to access the dongle's IQ sample stream.
+.LP
+The "type" argument selects the dongle type, 1 for Classic, 2 for Pro+.
+.SH OsmoSDR Source
+.TP
+Argument
+Notes
+.TP
+osmosdr=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.SH RTL-SDR Source
+.TP
+Argument
+Notes
+.TP
+rtl=<device-index>
+0-based device identifier OR serial number
+.TP
+rtl_xtal=<frequency>
+Frequency (Hz) used for the RTL chip, accepts eng notation
+.TP
+tuner_xtal=<frequency>
+Frequency (Hz) used for the tuner chip, accepts eng notation
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip. 0: Disable, 1: use I channel, 2: use Q channel
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.LP
+NOTE: use rtl_eeprom -s to program your own serial number to the device
+.LP
+NOTE: if you don't specify rtl_xtal/tuner_xtal, the underlying driver will use 28.0MHz
+.SH RTL-SDR TCP Source
+.TP
+Argument
+Notes
+.TP
+rtl_tcp=<hostname>:<port>
+hostname defaults to "localhost", port to "1234"
+.TP
+psize=<payload-size>
+Default is 16384 bytes
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip 0=Off, 1=I-ADC input enabled, 2=Q-ADC input enabled
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.SH Miri Source
+.TP
+Argument
+Notes
+.TP
+miri=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.SH UHD Source / Sink
+Argument
+Notes
+.TP
+uhd
+Use this argument without a value
+.TP
+nchan=<channel-count>
+For multichannel USRP configurations use the subdev parameter to specify stream mapping
+.TP
+subdev=<subdev-spec>
+Examples: "A:0", "B:0", "A:0 B:0" when nchan=2. Refer original ettus documentation on this
+.TP
+lo_offset=<frequency>
+Offset frequency in Hz, must be within daughterboard bandwidth. Accepts eng notation
+.LP
+Additional argument/value pairs will be passed to the underlying driver, for more information see ​specifying the subdevice and ​common device identifiers in the Ettus documentation.
+.SH bladeRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+bladerf[=0]
+0-based device identifier (optional)
+.TP
+fw='/path/to/the/firmware.img'
+program MCU firmware from given file. usually not needed. power cycle required.
+.TP
+fpga='/path/to/the/bitstream.rbf'
+load FPGA bitstream from given file. required only at first run at the moment.
+.SH HackRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+hackrf
+Use this argument without a value
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.LP
+Only the first device found may be used at the moment because of libhackrf limitation.
+.LP
+Transmit support has been verified by using the crc-mmbTools DAB sdr transmitter.
+.SH IQ File Source
+.TP
+Argument
+Notes
+.TP
+file=<path-to-file-name>
+.TP
+freq=<frequency>
+Center frequency in Hz, accepts eng notation
+.TP
+rate=<sampling-rate>
+Mandatory, in samples/s, accepts eng notation
+.TP
+repeat=true|false
+Default is true
+.TP
+throttle=true|false
+Throttle flow of samples, default is true
+.SH EXAMPLES
+.LP
+osmocom_siggen_nogui -a hackrf -f 100e6 --sweep -x 2e6 -y 10 -v
+.LP
+osmocom_siggen_nogui -a uhd,subdev=A:0 -f 100e6 --sweep -x 2e6 -y 10 -s 4e6 -v
+.SH "SEE ALSO"
+osmocom_fft(1) osmocom_siggen(1) osmocom_spectrum_sense(1)
diff --git a/debian/osmocom_spectrum_sense.1 b/debian/osmocom_spectrum_sense.1
new file mode 100644
index 0000000..d10b1d4
--- /dev/null
+++ b/debian/osmocom_spectrum_sense.1
@@ -0,0 +1,196 @@
+.TH osmocom_spectrum_sense "1" "October 2013" "OSMOCOMM" "User Commands"
+.SH NAME
+osmocom_spectrum_sense \- GNU Radio application from OsmoSDR
+.SH SYNOPSIS
+.B osmocom_spectrum_sense
+[\fIoptions\fR] \fImin_freq max_freq\fR
+.SH DESCRIPTION
+GNU Radio application from OsmoSDR
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit
+.TP
+\fB\-a\fR ARGS, \fB\-\-args\fR=\fIARGS\fR
+Device args [default=]
+.TP
+\fB\-A\fR ANTENNA, \fB\-\-antenna\fR=\fIANTENNA\fR
+Select antenna where appropriate
+.TP
+\fB\-s\fR SAMP_RATE, \fB\-\-samp\-rate\fR=\fISAMP_RATE\fR
+Set sample rate (bandwidth), minimum by default
+.TP
+\fB\-g\fR GAIN, \fB\-\-gain\fR=\fIGAIN\fR
+Set gain in dB (default is midpoint)
+.TP
+\fB\-\-tune\-delay\fR=\fISECS\fR
+Time to delay (in seconds) after changing frequency
+[default=0.25]
+.TP
+\fB\-\-dwell\-delay\fR=\fISECS\fR
+Time to dwell (in seconds) at a given frequency
+[default=0.25]
+.TP
+\fB\-b\fR Hz, \fB\-\-channel\-bandwidth\fR=\fIHz\fR
+Channel bandwidth of fft bins in Hz [default=6250.0]
+.TP
+\fB\-q\fR dB, \fB\-\-squelch\-threshold\fR=\fIdB\fR
+Squelch threshold in dB [default=none]
+.TP
+\fB\-F\fR FFT_SIZE, \fB\-\-fft\-size\fR=\fIFFT_SIZE\fR
+Specify number of FFT bins
+[default=samp_rate/channel_bw]
+.TP
+\fB\-\-real\-time\fR
+Attempt to enable real\-time scheduling
+.SH Device specification
+You can specify the source or sink device using a comma separated string of argument=value pairs. The always-up-to-date block documentation with examples is available ​right here.
+.SH FCD Source
+.TP
+Argument
+Notes
+.TP
+fcd=<device-index>
+0-based device identifier, optional
+.TP
+device=hw:2
+overrides the audio device
+.TP
+type=2
+selects the dongle type, 1 for Classic, 2 for Pro+
+.LP
+The "device" argument overrides the audio device used by the underlying driver to access the dongle's IQ sample stream.
+.LP
+The "type" argument selects the dongle type, 1 for Classic, 2 for Pro+.
+.SH OsmoSDR Source
+.TP
+Argument
+Notes
+.TP
+osmosdr=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.SH RTL-SDR Source
+.TP
+Argument
+Notes
+.TP
+rtl=<device-index>
+0-based device identifier OR serial number
+.TP
+rtl_xtal=<frequency>
+Frequency (Hz) used for the RTL chip, accepts eng notation
+.TP
+tuner_xtal=<frequency>
+Frequency (Hz) used for the tuner chip, accepts eng notation
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.TP
+buflen=<length-of-buffer>
+Default is 256kB, must be multiple of 512
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip. 0: Disable, 1: use I channel, 2: use Q channel
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.LP
+NOTE: use rtl_eeprom -s to program your own serial number to the device
+.LP
+NOTE: if you don't specify rtl_xtal/tuner_xtal, the underlying driver will use 28.0MHz
+.SH RTL-SDR TCP Source
+.TP
+Argument
+Notes
+.TP
+rtl_tcp=<hostname>:<port>
+hostname defaults to "localhost", port to "1234"
+.TP
+psize=<payload-size>
+Default is 16384 bytes
+.TP
+direct_samp=0|1|2
+Enable direct sampling mode on the RTL chip 0=Off, 1=I-ADC input enabled, 2=Q-ADC input enabled
+.TP
+offset_tune=0|1
+Enable offset tune mode for E4000 tuners
+.SH Miri Source
+.TP
+Argument
+Notes
+.TP
+miri=<device-index>
+0-based device identifier
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.SH UHD Source / Sink
+Argument
+Notes
+.TP
+uhd
+Use this argument without a value
+.TP
+nchan=<channel-count>
+For multichannel USRP configurations use the subdev parameter to specify stream mapping
+.TP
+subdev=<subdev-spec>
+Examples: "A:0", "B:0", "A:0 B:0" when nchan=2. Refer original ettus documentation on this
+.TP
+lo_offset=<frequency>
+Offset frequency in Hz, must be within daughterboard bandwidth. Accepts eng notation
+.LP
+Additional argument/value pairs will be passed to the underlying driver, for more information see ​specifying the subdevice and ​common device identifiers in the Ettus documentation.
+.SH bladeRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+bladerf[=0]
+0-based device identifier (optional)
+.TP
+fw='/path/to/the/firmware.img'
+program MCU firmware from given file. usually not needed. power cycle required.
+.TP
+fpga='/path/to/the/bitstream.rbf'
+load FPGA bitstream from given file. required only at first run at the moment.
+.SH HackRF Source / Sink
+.TP
+Argument
+Notes
+.TP
+hackrf
+Use this argument without a value
+.TP
+buffers=<number-of-buffers>
+Default is 32
+.LP
+Only the first device found may be used at the moment because of libhackrf limitation.
+.LP
+Transmit support has been verified by using the crc-mmbTools DAB sdr transmitter.
+.SH IQ File Source
+.TP
+Argument
+Notes
+.TP
+file=<path-to-file-name>
+.TP
+freq=<frequency>
+Center frequency in Hz, accepts eng notation
+.TP
+rate=<sampling-rate>
+Mandatory, in samples/s, accepts eng notation
+.TP
+repeat=true|false
+Default is true
+.TP
+throttle=true|false
+Throttle flow of samples, default is true
+.SH "SEE ALSO"
+osmocom_fft(1) osmocom_siggen(1) osmocom_siggen_nogui(1)
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..02d7ad7
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,29 @@
+#!/usr/bin/make -f
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+export DEB_HOST_MULTIARCH
+DEB_DEBIAN_DIR=$(dir $(firstword $(MAKEFILE_LIST)))
+VER=$(shell dpkg-parsechangelog -l$(DEB_DEBIAN_DIR)/changelog \
+ | sed -rne 's,^Version: ([^-]+).*,\1,p')
+GITREV=$(shell echo $(VER) | sed -rne 's,[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.([0-f]+),\1,p')
+
+%:
+ dh $@ --with python2
+
+override_dh_auto_configure:
+ dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" -DPythonLibs_FIND_VERSION:STRING="2.7" -DPYTHON_EXECUTABLE:STRING="/usr/bin/python"
+
+override_dh_auto_install:
+ dh_auto_install
+ rm -f debian/gr-osmosdr/usr/lib/python2.7/dist-packages/osmosdr/*pyc
+ rm -f debian/gr-osmosdr/usr/lib/python2.7/dist-packages/osmosdr/*pyo
+
+override_dh_makeshlibs:
+ dh_makeshlibs -V 'libgnuradio-osmosdr0.1.4 (>= 0.1.4-13)'
+
+version-to-get:
+ echo $(VER) is $(GITREV)
+
+get-orig-source: version-to-get
+ git clone https://gitea.osmocom.org/sdr/gr-osmosdr
+ cd gr-osmosdr && git archive --format=tar --prefix=gr-osmosdr-$(VER)/ $(GITREV) | xz > ../gr-osmosdr_$(VER).orig.tar.xz
+ rm -rf gr-osmosdr
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..879e5c7
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts="downloadurlmangle=s/refs\/tags/snapshot/,uversionmangle=s|(.*)git|1|" \
+ http://cgit.osmocom.org/gr-osmosdr/refs/tags /gr-osmosdr/snapshot/gr-osmosdr-(\d.*)\.tar\.xz
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 446b86a..aa620b4 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
diff --git a/docs/doxygen/CMakeLists.txt b/docs/doxygen/CMakeLists.txt
index 1b44799..179104b 100644
--- a/docs/doxygen/CMakeLists.txt
+++ b/docs/doxygen/CMakeLists.txt
@@ -1,6 +1,7 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gr-osmosdr
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in
index 8dde978..db80050 100644
--- a/docs/doxygen/Doxyfile.in
+++ b/docs/doxygen/Doxyfile.in
@@ -1,14 +1,16 @@
-# Doxyfile 1.5.7.1
+# Doxyfile 1.8.4
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a double hash (##) is considered a comment and is placed
+# in front of the TAG it is preceding .
+# All text after a hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# Values that contain spaces should be placed between quotes (" ").
#---------------------------------------------------------------------------
# Project related configuration options
@@ -22,10 +24,11 @@
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
-PROJECT_NAME = "GNU Radio's OsmoSDR Package"
+PROJECT_NAME = "GNU Radio's TEST Package"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
@@ -33,6 +36,19 @@ PROJECT_NAME = "GNU Radio's OsmoSDR Package"
PROJECT_NUMBER =
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
@@ -54,11 +70,11 @@ CREATE_SUBDIRS = NO
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
-# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
-# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
-# Spanish, Swedish, and Ukrainian.
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian,
+# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic,
+# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
@@ -112,7 +128,9 @@ FULL_PATH_NAMES = NO
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
-# path to strip.
+# path to strip. Note that you specify absolute paths here, but also
+# relative paths, which will be relative from the directory where doxygen is
+# started.
STRIP_FROM_PATH =
@@ -126,7 +144,7 @@ STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
+# (but less readable) file names. This can be useful if your file system
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
@@ -181,6 +199,13 @@ TAB_SIZE = 8
ALIASES =
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST =
+
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
@@ -207,11 +232,40 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension,
+# and language is one of the parsers supported by doxygen: IDL, Java,
+# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
+# C++. For instance to make doxygen treat .inc files as Fortran files (default
+# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
+# that for custom extensions you also need to set FILE_PATTERNS otherwise the
+# files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+
+AUTOLINK_SUPPORT = YES
+
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
+# func(std::string) {}). This also makes the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = YES
@@ -227,10 +281,10 @@ CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES (the
+# default) will make doxygen replace the get and set methods by a property in
+# the documentation. This will only work if the methods are indeed getting or
# setting a simple type. If this is not the case, or you want to show the
# methods anyway, you should set this option to NO.
@@ -251,6 +305,22 @@ DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields or simple typedef fields will be shown
+# inline in the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO (the default), structs, classes, and unions are shown on a separate
+# page (for HTML and Man pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
@@ -261,21 +331,16 @@ SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 4
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can
+# be an expensive process and often the same symbol appear multiple times in
+# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too
+# small doxygen will become slower. If the cache is too large, memory is wasted.
+# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid
+# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536
+# symbols.
+
+LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
@@ -284,7 +349,7 @@ SYMBOL_CACHE_SIZE = 4
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
@@ -293,6 +358,11 @@ EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+
+EXTRACT_PACKAGE = NO
+
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
@@ -315,7 +385,7 @@ EXTRACT_LOCAL_METHODS = NO
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
+# anonymous namespaces are hidden.
EXTRACT_ANON_NSPACES = NO
@@ -375,6 +445,12 @@ HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
@@ -394,6 +470,16 @@ SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
# hierarchy of group names into alphabetical order. If set to NO (the default)
# the group names will appear in their defined order.
@@ -410,6 +496,15 @@ SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
@@ -435,15 +530,16 @@ GENERATE_BUGLIST = NO
GENERATE_DEPRECATEDLIST= NO
# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
+# documentation sections, marked by \if section-label ... \endif
+# and \cond section-label ... \endcond blocks.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
+# the initial value of a variable or macro consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
+# The appearance of the initializer of individual variables and macros in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
@@ -455,12 +551,6 @@ MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
@@ -468,7 +558,8 @@ SHOW_DIRECTORIES = NO
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
# and from the Folder Tree View (if specified). The default is YES.
SHOW_NAMESPACES = NO
@@ -483,15 +574,26 @@ SHOW_NAMESPACES = NO
FILE_VERSION_FILTER =
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path. Do not use
+# file names with spaces, bibtex cannot handle them.
+
+CITE_BIB_FILES =
+
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -520,7 +622,7 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
# functions that are documented, but have no documentation for their parameters
# or return value. If set to NO (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
@@ -552,7 +654,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @top_srcdir@ @top_builddir@
+INPUT = "@top_srcdir@" \
+ "@top_builddir@"
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -566,8 +669,9 @@ INPUT_ENCODING = UTF-8
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS = *.h \
*.dox
@@ -578,18 +682,20 @@ FILE_PATTERNS = *.h \
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should
+# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
EXCLUDE = @abs_top_builddir@/docs/doxygen/html \
- @abs_top_builddir@/docs/doxygen/xml \
+ @abs_top_builddir@/docs/doxygen/xml \
@abs_top_builddir@/docs/doxygen/other/doxypy.py \
- @abs_top_builddir@/_CPack_Packages \
+ @abs_top_builddir@/_CPack_Packages \
@abs_top_srcdir@/cmake
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
@@ -667,19 +773,24 @@ IMAGE_PATH =
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be ignored.
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
-FILTER_PATTERNS = *.py=@top_srcdir@/gnuradio-runtime/doc/other/doxypy.py
+FILTER_PATTERNS = *.py="@top_srcdir@"/doc/doxygen/other/doxypy.py
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
@@ -687,6 +798,21 @@ FILTER_PATTERNS = *.py=@top_srcdir@/gnuradio-runtime/doc/other/doxypy.py
FILTER_SOURCE_FILES = NO
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
@@ -705,7 +831,7 @@ INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
STRIP_CODE_COMMENTS = NO
@@ -724,7 +850,8 @@ REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code. Otherwise they will link to the documentstion.
+# link to the source code.
+# Otherwise they will link to the documentation.
REFERENCES_LINK_SOURCE = YES
@@ -788,7 +915,14 @@ HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
HTML_HEADER =
@@ -800,27 +934,80 @@ HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
+# fine-tune the look of the HTML output. If left blank doxygen will
+# generate a default style sheet. Note that it is recommended to use
+# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
+# tag will in the future become obsolete.
HTML_STYLESHEET =
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
+# user-defined cascading style sheet that is included after the standard
+# style sheets created by doxygen. Using this option one can overrule
+# certain style aspects. This is preferred over using HTML_STYLESHEET
+# since it does not replace the standard style sheet and is therefore more
+# robust against future updates. Doxygen will copy the style sheet file to
+# the output directory.
-HTML_ALIGN_MEMBERS = YES
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+# page has loaded.
HTML_DYNAMIC_SECTIONS = NO
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OSX 10.5 (Leopard).
@@ -829,7 +1016,8 @@ HTML_DYNAMIC_SECTIONS = NO
# directory and running "make install" will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
GENERATE_DOCSET = NO
@@ -847,6 +1035,16 @@ DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
+# identify the documentation publisher. This should be a reverse domain-name
+# style string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
@@ -891,10 +1089,10 @@ BINARY_TOC = NO
TOC_EXPAND = YES
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
GENERATE_QHP = NO
@@ -906,57 +1104,99 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+# http://doc.trolltech.com/qthelpproject.html#namespace
QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
QHP_VIRTUAL_FOLDER = doc
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
# be used to specify the location of Qt's qhelpgenerator.
# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file .
+# .qhp file.
QHG_LOCATION =
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
-DISABLE_INDEX = YES
+GENERATE_ECLIPSEHELP = NO
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
-ENUM_VALUES_PER_LINE = 4
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX = YES
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
-# If the tag value is set to FRAME, a side panel will be generated
+# If the tag value is set to YES, a side panel will be generated
# containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature. Other possible values
-# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list;
-# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
-# disables this behavior completely. For backwards compatibility with previous
-# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
-# respectively.
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
GENERATE_TREEVIEW = YES
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE = 4
+
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 180
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# when you change the font size after a successful doxygen run you need
@@ -965,6 +1205,112 @@ TREEVIEW_WIDTH = 180
FORMULA_FONTSIZE = 10
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
+# SVG. The default value is HTML-CSS, which is slower, but has the best
+# compatibility.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript
+# pieces of code that will be used on startup of the MathJax code.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript.
+# There are two flavours of web server based search depending on the
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
+# searching and an index file used by the script. When EXTERNAL_SEARCH is
+# enabled the indexing and searching needs to be provided by external tools.
+# See the manual for details.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain
+# the search results. Doxygen ships with an example indexer (doxyindexer) and
+# search engine (doxysearch.cgi) which are based on the open source search
+# engine library Xapian. See the manual for configuration details.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will returned the search results when EXTERNAL_SEARCH is enabled.
+# Doxygen ships with an example search engine (doxysearch) which is based on
+# the open source search engine library Xapian. See the manual for configuration
+# details.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
+# of to a relative location where the documentation can be found.
+# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+
+EXTRA_SEARCH_MAPPINGS =
+
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
@@ -982,6 +1328,9 @@ LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
LATEX_CMD_NAME = latex
@@ -998,8 +1347,8 @@ MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4 will be used.
PAPER_TYPE = letter
@@ -1015,6 +1364,20 @@ EXTRA_PACKAGES =
LATEX_HEADER =
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images
+# or other source files which should be copied to the LaTeX output directory.
+# Note that the files will be copied as-is; there are no commands or markers
+# available.
+
+LATEX_EXTRA_FILES =
+
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
@@ -1041,6 +1404,19 @@ LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -1072,7 +1448,7 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# Load style sheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
@@ -1127,18 +1503,6 @@ GENERATE_XML = @enable_xml_docs@
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
@@ -1147,6 +1511,21 @@ XML_DTD =
XML_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
+# configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files
+# that can be used to generate PDF.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it. If left blank docbook will be used as the default path.
+
+DOCBOOK_OUTPUT = docbook
+
+#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
@@ -1177,8 +1556,10 @@ GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
# tag is set to NO the size of the Perl module output will be much smaller
# and Perl will parse it just the same.
@@ -1215,7 +1596,7 @@ MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
SEARCH_INCLUDES = YES
@@ -1245,15 +1626,15 @@ PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
SKIP_FUNCTION_MACROS = YES
@@ -1261,20 +1642,18 @@ SKIP_FUNCTION_MACROS = YES
# Configuration::additions related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
TAGFILES =
@@ -1295,6 +1674,12 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed
+# in the related pages index. If set to NO, only the current project's
+# pages will be listed.
+
+EXTERNAL_PAGES = YES
+
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
@@ -1307,9 +1692,8 @@ PERL_PATH = /usr/bin/perl
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
CLASS_DIAGRAMS = YES
@@ -1335,33 +1719,38 @@ HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = @HAVE_DOT@
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
-DOT_FONTNAME = FreeSans
+DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
+# CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
@@ -1383,6 +1772,15 @@ GROUP_GRAPHS = YES
UML_LOOK = NO
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# manageable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS = 10
+
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
@@ -1419,11 +1817,11 @@ CALL_GRAPH = NO
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
+# will generate a graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
@@ -1431,11 +1829,22 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
DOT_IMAGE_FORMAT = png
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
@@ -1447,6 +1856,12 @@ DOT_PATH =
DOTFILE_DIRS =
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
@@ -1493,12 +1908,3 @@ GENERATE_LEGEND = YES
# the various graphs.
DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
diff --git a/docs/doxygen/Doxyfile.swig_doc.in b/docs/doxygen/Doxyfile.swig_doc.in
index 50b8aa8..cbe06d6 100644
--- a/docs/doxygen/Doxyfile.swig_doc.in
+++ b/docs/doxygen/Doxyfile.swig_doc.in
@@ -1,14 +1,16 @@
-# Doxyfile 1.6.1
+# Doxyfile 1.8.4
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a double hash (##) is considered a comment and is placed
+# in front of the TAG it is preceding .
+# All text after a hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# Values that contain spaces should be placed between quotes (" ").
#---------------------------------------------------------------------------
# Project related configuration options
@@ -22,8 +24,9 @@
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
PROJECT_NAME = @CPACK_PACKAGE_NAME@
@@ -33,12 +36,25 @@ PROJECT_NAME = @CPACK_PACKAGE_NAME@
PROJECT_NUMBER = @CPACK_PACKAGE_VERSION@
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@
+OUTPUT_DIRECTORY = "@OUTPUT_DIRECTORY@"
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@@ -56,9 +72,9 @@ CREATE_SUBDIRS = NO
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian,
+# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic,
+# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
@@ -105,14 +121,16 @@ INLINE_INHERITED_MEMB = NO
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
-FULL_PATH_NAMES = YES
+FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
-# path to strip.
+# path to strip. Note that you specify absolute paths here, but also
+# relative paths, which will be relative from the directory where doxygen is
+# started.
STRIP_FROM_PATH =
@@ -126,7 +144,7 @@ STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
+# (but less readable) file names. This can be useful if your file system
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
@@ -181,6 +199,13 @@ TAB_SIZE = 8
ALIASES =
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST =
+
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
@@ -207,22 +232,40 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension,
+# and language is one of the parsers supported by doxygen: IDL, Java,
+# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
+# C++. For instance to make doxygen treat .inc files as Fortran files (default
+# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
+# that for custom extensions you also need to set FILE_PATTERNS otherwise the
+# files are not read by doxygen.
EXTENSION_MAPPING =
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+
+AUTOLINK_SUPPORT = YES
+
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
+# func(std::string) {}). This also makes the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = YES
@@ -238,10 +281,10 @@ CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES (the
+# default) will make doxygen replace the get and set methods by a property in
+# the documentation. This will only work if the methods are indeed getting or
# setting a simple type. If this is not the case, or you want to show the
# methods anyway, you should set this option to NO.
@@ -262,6 +305,22 @@ DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields or simple typedef fields will be shown
+# inline in the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO (the default), structs, classes, and unions are shown on a separate
+# page (for HTML and Man pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
@@ -272,21 +331,16 @@ SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can
+# be an expensive process and often the same symbol appear multiple times in
+# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too
+# small doxygen will become slower. If the cache is too large, memory is wasted.
+# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid
+# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536
+# symbols.
+
+LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
@@ -295,7 +349,7 @@ SYMBOL_CACHE_SIZE = 0
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
@@ -304,6 +358,11 @@ EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+
+EXTRACT_PACKAGE = NO
+
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
@@ -326,7 +385,7 @@ EXTRACT_LOCAL_METHODS = NO
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
+# anonymous namespaces are hidden.
EXTRACT_ANON_NSPACES = NO
@@ -386,6 +445,12 @@ HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
@@ -405,7 +470,13 @@ SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
SORT_MEMBERS_CTORS_1ST = NO
@@ -425,6 +496,15 @@ SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
@@ -450,15 +530,16 @@ GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
+# documentation sections, marked by \if section-label ... \endif
+# and \cond section-label ... \endcond blocks.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
+# the initial value of a variable or macro consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
+# The appearance of the initializer of individual variables and macros in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
@@ -470,12 +551,6 @@ MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
@@ -499,15 +574,26 @@ SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path. Do not use
+# file names with spaces, bibtex cannot handle them.
+
+CITE_BIB_FILES =
+
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -536,7 +622,7 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
# functions that are documented, but have no documentation for their parameters
# or return value. If set to NO (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
@@ -582,8 +668,9 @@ INPUT_ENCODING = UTF-8
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS = *.h
@@ -593,14 +680,16 @@ FILE_PATTERNS = *.h
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should
+# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
EXCLUDE =
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
@@ -653,8 +742,10 @@ IMAGE_PATH =
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# If FILTER_PATTERNS is specified, this tag will be ignored.
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
INPUT_FILTER =
@@ -664,8 +755,8 @@ INPUT_FILTER =
# filter if there is a match.
# The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
FILTER_PATTERNS =
@@ -675,6 +766,21 @@ FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
@@ -693,7 +799,7 @@ INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
STRIP_CODE_COMMENTS = YES
@@ -777,7 +883,14 @@ HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
HTML_HEADER =
@@ -789,27 +902,80 @@ HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
+# fine-tune the look of the HTML output. If left blank doxygen will
+# generate a default style sheet. Note that it is recommended to use
+# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
+# tag will in the future become obsolete.
HTML_STYLESHEET =
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
+# user-defined cascading style sheet that is included after the standard
+# style sheets created by doxygen. Using this option one can overrule
+# certain style aspects. This is preferred over using HTML_STYLESHEET
+# since it does not replace the standard style sheet and is therefore more
+# robust against future updates. Doxygen will copy the style sheet file to
+# the output directory.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
-HTML_ALIGN_MEMBERS = YES
+HTML_TIMESTAMP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+# page has loaded.
HTML_DYNAMIC_SECTIONS = NO
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OSX 10.5 (Leopard).
@@ -818,7 +984,8 @@ HTML_DYNAMIC_SECTIONS = NO
# directory and running "make install" will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
GENERATE_DOCSET = NO
@@ -836,6 +1003,16 @@ DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
+# identify the documentation publisher. This should be a reverse domain-name
+# style string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
@@ -880,10 +1057,10 @@ BINARY_TOC = NO
TOC_EXPAND = NO
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
GENERATE_QHP = NO
@@ -905,20 +1082,24 @@ QHP_NAMESPACE =
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
# http://doc.trolltech.com/qthelpproject.html#custom-filters
QHP_CUST_FILTER_NAME =
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
QHP_CUST_FILTER_ATTRS =
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
QHP_SECT_FILTER_ATTRS =
@@ -929,16 +1110,30 @@ QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
-DISABLE_INDEX = NO
+GENERATE_ECLIPSEHELP = NO
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
-ENUM_VALUES_PER_LINE = 4
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
@@ -947,13 +1142,17 @@ ENUM_VALUES_PER_LINE = 4
# is generated for HTML Help). For this to work a browser that supports
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
GENERATE_TREEVIEW = NO
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
-USE_INLINE_TREES = NO
+ENUM_VALUES_PER_LINE = 4
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
@@ -961,6 +1160,11 @@ USE_INLINE_TREES = NO
TREEVIEW_WIDTH = 250
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# when you change the font size after a successful doxygen run you need
@@ -969,13 +1173,112 @@ TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
-# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP)
-# there is already a search function so this one should typically
-# be disabled.
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
+# SVG. The default value is HTML-CSS, which is slower, but has the best
+# compatibility.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript
+# pieces of code that will be used on startup of the MathJax code.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = YES
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript.
+# There are two flavours of web server based search depending on the
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
+# searching and an index file used by the script. When EXTERNAL_SEARCH is
+# enabled the indexing and searching needs to be provided by external tools.
+# See the manual for details.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain
+# the search results. Doxygen ships with an example indexer (doxyindexer) and
+# search engine (doxysearch.cgi) which are based on the open source search
+# engine library Xapian. See the manual for configuration details.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will returned the search results when EXTERNAL_SEARCH is enabled.
+# Doxygen ships with an example search engine (doxysearch) which is based on
+# the open source search engine library Xapian. See the manual for configuration
+# details.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
+# of to a relative location where the documentation can be found.
+# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+
+EXTRA_SEARCH_MAPPINGS =
+
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
@@ -993,6 +1296,9 @@ LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
LATEX_CMD_NAME = latex
@@ -1009,8 +1315,8 @@ MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4 will be used.
PAPER_TYPE = a4wide
@@ -1026,6 +1332,20 @@ EXTRA_PACKAGES =
LATEX_HEADER =
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images
+# or other source files which should be copied to the LaTeX output directory.
+# Note that the files will be copied as-is; there are no commands or markers
+# available.
+
+LATEX_EXTRA_FILES =
+
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
@@ -1052,10 +1372,19 @@ LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
LATEX_SOURCE_CODE = NO
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -1087,7 +1416,7 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# Load style sheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
@@ -1142,18 +1471,6 @@ GENERATE_XML = YES
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
@@ -1162,6 +1479,21 @@ XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
+# configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files
+# that can be used to generate PDF.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it. If left blank docbook will be used as the default path.
+
+DOCBOOK_OUTPUT = docbook
+
+#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
@@ -1232,7 +1564,7 @@ MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
SEARCH_INCLUDES = YES
@@ -1262,15 +1594,15 @@ PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
SKIP_FUNCTION_MACROS = YES
@@ -1278,22 +1610,18 @@ SKIP_FUNCTION_MACROS = YES
# Configuration::additions related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
#
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
#
# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
TAGFILES =
@@ -1314,6 +1642,12 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed
+# in the related pages index. If set to NO, only the current project's
+# pages will be listed.
+
+EXTERNAL_PAGES = YES
+
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
@@ -1326,9 +1660,8 @@ PERL_PATH = /usr/bin/perl
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
CLASS_DIAGRAMS = YES
@@ -1354,33 +1687,38 @@ HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
-DOT_FONTNAME = FreeSans
+DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
+# CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
@@ -1402,6 +1740,15 @@ GROUP_GRAPHS = YES
UML_LOOK = NO
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# manageable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS = 10
+
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
@@ -1438,11 +1785,11 @@ CALL_GRAPH = NO
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
+# will generate a graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
@@ -1450,11 +1797,22 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
DOT_IMAGE_FORMAT = png
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
@@ -1466,6 +1824,12 @@ DOT_PATH =
DOTFILE_DIRS =
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
diff --git a/docs/doxygen/doxyxml/__init__.py b/docs/doxygen/doxyxml/__init__.py
index 5cd0b3c..9efa3d7 100644
--- a/docs/doxygen/doxyxml/__init__.py
+++ b/docs/doxygen/doxyxml/__init__.py
@@ -1,7 +1,8 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gr-osmosdr
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -63,8 +64,9 @@ This line is uninformative and is only to test line breaks in the comments.
u'Outputs the vital aadvark statistics.'
"""
+from __future__ import unicode_literals
-from doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
+from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
def _test():
import os
diff --git a/docs/doxygen/doxyxml/base.py b/docs/doxygen/doxyxml/base.py
index e8f026a..df1da04 100644
--- a/docs/doxygen/doxyxml/base.py
+++ b/docs/doxygen/doxyxml/base.py
@@ -1,7 +1,8 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gr-osmosdr
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,24 +25,26 @@ A base class is created.
Classes based upon this are used to make more user-friendly interfaces
to the doxygen xml docs than the generated classes provide.
"""
+from __future__ import print_function
+from __future__ import unicode_literals
import os
import pdb
from xml.parsers.expat import ExpatError
-from generated import compound
+from .generated import compound
class Base(object):
- class Duplicate(StandardError):
+ class Duplicate(Exception):
pass
- class NoSuchMember(StandardError):
+ class NoSuchMember(Exception):
pass
- class ParsingError(StandardError):
+ class ParsingError(Exception):
pass
def __init__(self, parse_data, top=None):
@@ -94,7 +97,7 @@ class Base(object):
for cls in self.mem_classes:
if cls.can_parse(mem):
return cls
- raise StandardError(("Did not find a class for object '%s'." \
+ raise Exception(("Did not find a class for object '%s'." \
% (mem.get_name())))
def convert_mem(self, mem):
@@ -102,11 +105,11 @@ class Base(object):
cls = self.get_cls(mem)
converted = cls.from_parse_data(mem, self.top)
if converted is None:
- raise StandardError('No class matched this object.')
+ raise Exception('No class matched this object.')
self.add_ref(converted)
return converted
- except StandardError, e:
- print e
+ except Exception as e:
+ print(e)
@classmethod
def includes(cls, inst):
diff --git a/docs/doxygen/doxyxml/doxyindex.py b/docs/doxygen/doxyxml/doxyindex.py
index 0132ab8..b4c7aef 100644
--- a/docs/doxygen/doxyxml/doxyindex.py
+++ b/docs/doxygen/doxyxml/doxyindex.py
@@ -1,7 +1,8 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gr-osmosdr
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,12 +23,14 @@
Classes providing more user-friendly interfaces to the doxygen xml
docs than the generated classes provide.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
import os
-from generated import index
-from base import Base
-from text import description
+from .generated import index
+from .base import Base
+from .text import description
class DoxyIndex(Base):
"""
@@ -43,13 +46,16 @@ class DoxyIndex(Base):
self._root = index.parse(os.path.join(self._xml_path, 'index.xml'))
for mem in self._root.compound:
converted = self.convert_mem(mem)
- # For files we want the contents to be accessible directly
- # from the parent rather than having to go through the file
- # object.
+ # For files and namespaces we want the contents to be
+ # accessible directly from the parent rather than having
+ # to go through the file object.
if self.get_cls(mem) == DoxyFile:
if mem.name.endswith('.h'):
self._members += converted.members()
self._members.append(converted)
+ elif self.get_cls(mem) == DoxyNamespace:
+ self._members += converted.members()
+ self._members.append(converted)
else:
self._members.append(converted)
@@ -80,13 +86,29 @@ class DoxyCompMem(Base):
self._data['brief_description'] = bd
self._data['detailed_description'] = dd
+ def set_parameters(self, data):
+ vs = [ddc.value for ddc in data.detaileddescription.content_]
+ pls = []
+ for v in vs:
+ if hasattr(v, 'parameterlist'):
+ pls += v.parameterlist
+ pis = []
+ for pl in pls:
+ pis += pl.parameteritem
+ dpis = []
+ for pi in pis:
+ dpi = DoxyParameterItem(pi)
+ dpi._parse()
+ dpis.append(dpi)
+ self._data['params'] = dpis
+
+
class DoxyCompound(DoxyCompMem):
pass
class DoxyMember(DoxyCompMem):
pass
-
class DoxyFunction(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
@@ -98,10 +120,13 @@ class DoxyFunction(DoxyMember):
return
super(DoxyFunction, self)._parse()
self.set_descriptions(self._parse_data)
- self._data['params'] = []
- prms = self._parse_data.param
- for prm in prms:
- self._data['params'].append(DoxyParam(prm))
+ self.set_parameters(self._parse_data)
+ if not self._data['params']:
+ # If the params weren't set by a comment then just grab the names.
+ self._data['params'] = []
+ prms = self._parse_data.param
+ for prm in prms:
+ self._data['params'].append(DoxyParam(prm))
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
@@ -121,9 +146,39 @@ class DoxyParam(DoxyMember):
self.set_descriptions(self._parse_data)
self._data['declname'] = self._parse_data.declname
+ @property
+ def description(self):
+ descriptions = []
+ if self.brief_description:
+ descriptions.append(self.brief_description)
+ if self.detailed_description:
+ descriptions.append(self.detailed_description)
+ return '\n\n'.join(descriptions)
+
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
- declname = property(lambda self: self.data()['declname'])
+ name = property(lambda self: self.data()['declname'])
+
+class DoxyParameterItem(DoxyMember):
+ """A different representation of a parameter in Doxygen."""
+
+ def _parse(self):
+ if self._parsed:
+ return
+ super(DoxyParameterItem, self)._parse()
+ names = []
+ for nl in self._parse_data.parameternamelist:
+ for pn in nl.parametername:
+ names.append(description(pn))
+ # Just take first name
+ self._data['name'] = names[0]
+ # Get description
+ pd = description(self._parse_data.get_parameterdescription())
+ self._data['description'] = pd
+
+ description = property(lambda self: self.data()['description'])
+ name = property(lambda self: self.data()['name'])
+
class DoxyClass(DoxyCompound):
@@ -139,12 +194,14 @@ class DoxyClass(DoxyCompound):
if self._error:
return
self.set_descriptions(self._retrieved_data.compounddef)
+ self.set_parameters(self._retrieved_data.compounddef)
# Sectiondef.kind tells about whether private or public.
# We just ignore this for now.
self.process_memberdefs()
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
+ params = property(lambda self: self.data()['params'])
Base.mem_classes.append(DoxyClass)
@@ -177,6 +234,16 @@ class DoxyNamespace(DoxyCompound):
kind = 'namespace'
+ def _parse(self):
+ if self._parsed:
+ return
+ super(DoxyNamespace, self)._parse()
+ self.retrieve_data()
+ self.set_descriptions(self._retrieved_data.compounddef)
+ if self._error:
+ return
+ self.process_memberdefs()
+
Base.mem_classes.append(DoxyNamespace)
@@ -227,11 +294,11 @@ class DoxyOther(Base):
__module__ = "gnuradio.utils.doxyxml"
- kinds = set(['variable', 'struct', 'union', 'define', 'typedef', 'enum', 'dir', 'page'])
+ kinds = set(['variable', 'struct', 'union', 'define', 'typedef', 'enum',
+ 'dir', 'page', 'signal', 'slot', 'property'])
@classmethod
def can_parse(cls, obj):
return obj.kind in cls.kinds
Base.mem_classes.append(DoxyOther)
-
diff --git a/docs/doxygen/doxyxml/example/Doxyfile b/docs/doxygen/doxyxml/example/Doxyfile
deleted file mode 100644
index 9780043..0000000
--- a/docs/doxygen/doxyxml/example/Doxyfile
+++ /dev/null
@@ -1,1551 +0,0 @@
-# Doxyfile 1.6.3
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME =
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY =
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
-
-LAYOUT_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT =
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS =
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = YES
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = YES
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/docs/doxygen/doxyxml/example/aadvark.cc b/docs/doxygen/doxyxml/example/aadvark.cc
deleted file mode 100644
index f91c1ba..0000000
--- a/docs/doxygen/doxyxml/example/aadvark.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio 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, or (at your option)
- * any later version.
- *
- * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-#include <iostream>
-#include "aadvark.h"
-
-void Aadvark::print() {
- std::cout << "aadvark is " << aadvarkness << "/10 aadvarky" << std::endl;
-}
-
-Aadvark::Aadvark(int aaness): aadvarkness(aaness) {}
-
-bool aadvarky_enough(Aadvark aad) {
- if (aad.get_aadvarkness() > 6)
- return true;
- else
- return false;
-}
-
-int Aadvark::get_aadvarkness() {
- return aadvarkness;
-}
-
-int main() {
- Aadvark arold = Aadvark(6);
- arold.print();
- if (aadvarky_enough(arold))
- std::cout << "He is aadvarky enough" << std::endl;
- else
- std::cout << "He is not aadvarky enough" << std::endl;
-}
-
diff --git a/docs/doxygen/doxyxml/example/aadvark.h b/docs/doxygen/doxyxml/example/aadvark.h
deleted file mode 100644
index d3c1744..0000000
--- a/docs/doxygen/doxyxml/example/aadvark.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio 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, or (at your option)
- * any later version.
- *
- * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-#include <iostream>
-
-/*!
- * \brief Models the mammal Aadvark.
- *
- * Sadly the model is incomplete and cannot capture all aspects of an aadvark yet.
- *
- * This line is uninformative and is only to test line breaks in the comments.
- */
-class Aadvark {
-public:
- //! \brief Outputs the vital aadvark statistics.
- void print();
- //! \param aaness The aadvarkness of an aadvark is a measure of how aadvarky it is.
- Aadvark(int aaness);
- int get_aadvarkness();
-private:
- int aadvarkness;
-};
-
-bool aadvarky_enough(Aadvark aad);
-
-int main();
diff --git a/docs/doxygen/doxyxml/example/xml/aadvark_8cc.xml b/docs/doxygen/doxyxml/example/xml/aadvark_8cc.xml
deleted file mode 100644
index f031e01..0000000
--- a/docs/doxygen/doxyxml/example/xml/aadvark_8cc.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.6.3">
- <compounddef id="aadvark_8cc" kind="file">
- <compoundname>aadvark.cc</compoundname>
- <includes local="no">iostream</includes>
- <includes refid="aadvark_8cc" local="yes">aadvark.h</includes>
- <includedby refid="aadvark_8cc" local="yes">aadvark.cc</includedby>
- <incdepgraph>
- <node id="0">
- <label>aadvark.cc</label>
- <link refid="aadvark.cc"/>
- <childnode refid="1" relation="include">
- </childnode>
- </node>
- <node id="1">
- <label>iostream</label>
- </node>
- </incdepgraph>
- <sectiondef kind="func">
- <memberdef kind="function" id="aadvark_8cc_1acb52858524210ec6dddc3e16d1e52946" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
- <type>bool</type>
- <definition>bool aadvarky_enough</definition>
- <argsstring>(Aadvark aad)</argsstring>
- <name>aadvarky_enough</name>
- <param>
- <type><ref refid="classAadvark" kindref="compound">Aadvark</ref></type>
- <declname>aad</declname>
- </param>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" line="10" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="10" bodyend="15"/>
- </memberdef>
- <memberdef kind="function" id="aadvark_8cc_1ae66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
- <type>int</type>
- <definition>int main</definition>
- <argsstring>()</argsstring>
- <name>main</name>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" line="21" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="21" bodyend="28"/>
- </memberdef>
- </sectiondef>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <programlisting>
-<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;iostream&gt;</highlight><highlight class="normal"></highlight></codeline>
-<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;aadvark.h&quot;</highlight><highlight class="normal"></highlight></codeline>
-<codeline lineno="3"><highlight class="normal"></highlight></codeline>
-<codeline lineno="4"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kindref="member" tooltip="Outputs the vital aadvark statistics.">Aadvark::print</ref>()<sp/>{</highlight></codeline>
-<codeline lineno="5"><highlight class="normal"><sp/><sp/>std::cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;aadvark<sp/>is<sp/>&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>aadvarkness<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;/10<sp/>aadvarky&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>std::endl;</highlight></codeline>
-<codeline lineno="6"><highlight class="normal">}</highlight></codeline>
-<codeline lineno="7"><highlight class="normal"></highlight></codeline>
-<codeline lineno="8"><highlight class="normal"><ref refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" kindref="member">Aadvark::Aadvark</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>aaness):<sp/>aadvarkness(aaness)<sp/>{}</highlight></codeline>
-<codeline lineno="9"><highlight class="normal"></highlight></codeline>
-<codeline lineno="10"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>aadvarky_enough(<ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>aad)<sp/>{</highlight></codeline>
-<codeline lineno="11"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(aad.get_aadvarkness()<sp/>&gt;<sp/>6)</highlight></codeline>
-<codeline lineno="12"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
-<codeline lineno="13"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
-<codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
-<codeline lineno="15"><highlight class="normal">}</highlight></codeline>
-<codeline lineno="16"><highlight class="normal"></highlight></codeline>
-<codeline lineno="17"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Aadvark::get_aadvarkness()<sp/>{</highlight></codeline>
-<codeline lineno="18"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>aadvarkness;</highlight></codeline>
-<codeline lineno="19"><highlight class="normal">}</highlight></codeline>
-<codeline lineno="20"><highlight class="normal"></highlight></codeline>
-<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>main()<sp/>{</highlight></codeline>
-<codeline lineno="22"><highlight class="normal"><sp/><sp/><ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>arold<sp/>=<sp/><ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref>(6);</highlight></codeline>
-<codeline lineno="23"><highlight class="normal"><sp/><sp/>arold.<ref refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kindref="member" tooltip="Outputs the vital aadvark statistics.">print</ref>();</highlight></codeline>
-<codeline lineno="24"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(aadvarky_enough(arold))</highlight></codeline>
-<codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/>std::cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;He<sp/>is<sp/>aadvarky<sp/>enough&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>std::endl;</highlight></codeline>
-<codeline lineno="26"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
-<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/>std::cout<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;He<sp/>is<sp/>not<sp/>aadvarky<sp/>enough&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>std::endl;</highlight></codeline>
-<codeline lineno="28"><highlight class="normal">}</highlight></codeline>
-<codeline lineno="29"><highlight class="normal"></highlight></codeline>
- </programlisting>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc"/>
- </compounddef>
-</doxygen>
diff --git a/docs/doxygen/doxyxml/example/xml/aadvark_8h.xml b/docs/doxygen/doxyxml/example/xml/aadvark_8h.xml
deleted file mode 100644
index a1854b6..0000000
--- a/docs/doxygen/doxyxml/example/xml/aadvark_8h.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.6.3">
- <compounddef id="aadvark_8h" kind="file">
- <compoundname>aadvark.h</compoundname>
- <includes local="no">iostream</includes>
- <incdepgraph>
- <node id="3">
- <label>aadvark.h</label>
- <link refid="aadvark.h"/>
- <childnode refid="4" relation="include">
- </childnode>
- </node>
- <node id="4">
- <label>iostream</label>
- </node>
- </incdepgraph>
- <innerclass refid="classAadvark" prot="public">Aadvark</innerclass>
- <sectiondef kind="func">
- <memberdef kind="function" id="aadvark_8h_1acb52858524210ec6dddc3e16d1e52946" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
- <type>bool</type>
- <definition>bool aadvarky_enough</definition>
- <argsstring>(Aadvark aad)</argsstring>
- <name>aadvarky_enough</name>
- <param>
- <type><ref refid="classAadvark" kindref="compound">Aadvark</ref></type>
- <declname>aad</declname>
- </param>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="21" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="10" bodyend="15"/>
- </memberdef>
- <memberdef kind="function" id="aadvark_8h_1ae66f6b31b5ad750f1fe042a706a4e3d4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
- <type>int</type>
- <definition>int main</definition>
- <argsstring>()</argsstring>
- <name>main</name>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="23" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="21" bodyend="28"/>
- </memberdef>
- </sectiondef>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <programlisting>
-<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;iostream&gt;</highlight><highlight class="normal"></highlight></codeline>
-<codeline lineno="2"><highlight class="normal"></highlight></codeline>
-<codeline lineno="10" refid="classAadvark" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>{</highlight></codeline>
-<codeline lineno="11"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
-<codeline lineno="13"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kindref="member" tooltip="Outputs the vital aadvark statistics.">print</ref>();</highlight></codeline>
-<codeline lineno="15"><highlight class="normal"><sp/><sp/><ref refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" kindref="member">Aadvark</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>aaness);</highlight></codeline>
-<codeline lineno="16"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>get_aadvarkness();</highlight></codeline>
-<codeline lineno="17"><highlight class="normal"></highlight><highlight class="keyword">private</highlight><highlight class="normal">:</highlight></codeline>
-<codeline lineno="18"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>aadvarkness;</highlight></codeline>
-<codeline lineno="19"><highlight class="normal">};</highlight></codeline>
-<codeline lineno="20"><highlight class="normal"></highlight></codeline>
-<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>aadvarky_enough(<ref refid="classAadvark" kindref="compound" tooltip="Models the mammal Aadvark.">Aadvark</ref><sp/>aad);</highlight></codeline>
-<codeline lineno="22"><highlight class="normal"></highlight></codeline>
-<codeline lineno="23"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>main();</highlight></codeline>
- </programlisting>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h"/>
- </compounddef>
-</doxygen>
diff --git a/docs/doxygen/doxyxml/example/xml/classAadvark.xml b/docs/doxygen/doxyxml/example/xml/classAadvark.xml
deleted file mode 100644
index 54fe8b3..0000000
--- a/docs/doxygen/doxyxml/example/xml/classAadvark.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.6.3">
- <compounddef id="classAadvark" kind="class" prot="public">
- <compoundname>Aadvark</compoundname>
- <includes refid="aadvark_8h" local="no">aadvark.h</includes>
- <sectiondef kind="private-attrib">
- <memberdef kind="variable" id="classAadvark_1ab79eb58d7bb9d5ddfa5d6f783836cab9" prot="private" static="no" mutable="no">
- <type>int</type>
- <definition>int Aadvark::aadvarkness</definition>
- <argsstring></argsstring>
- <name>aadvarkness</name>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="18" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" bodystart="18" bodyend="-1"/>
- </memberdef>
- </sectiondef>
- <sectiondef kind="public-func">
- <memberdef kind="function" id="classAadvark_1abd061aa5f998002e72080a34f512a059" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
- <type>void</type>
- <definition>void Aadvark::print</definition>
- <argsstring>()</argsstring>
- <name>print</name>
- <briefdescription>
-<para>Outputs the vital aadvark statistics. </para> </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="13" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="4" bodyend="6"/>
- </memberdef>
- <memberdef kind="function" id="classAadvark_1adf1a4b97a641411a74a04ab312484462" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
- <type></type>
- <definition>Aadvark::Aadvark</definition>
- <argsstring>(int aaness)</argsstring>
- <name>Aadvark</name>
- <param>
- <type>int</type>
- <declname>aaness</declname>
- </param>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
-<para><parameterlist kind="param"><parameteritem>
-<parameternamelist>
-<parametername>aaness</parametername>
-</parameternamelist>
-<parameterdescription>
-<para>The aadvarkness of an aadvark is a measure of how aadvarky it is. </para></parameterdescription>
-</parameteritem>
-</parameterlist>
-</para> </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="15" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="8" bodyend="8"/>
- </memberdef>
- <memberdef kind="function" id="classAadvark_1affd2ada0a85807efcbe26615a848f53e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
- <type>int</type>
- <definition>int Aadvark::get_aadvarkness</definition>
- <argsstring>()</argsstring>
- <name>get_aadvarkness</name>
- <briefdescription>
- </briefdescription>
- <detaileddescription>
- </detaileddescription>
- <inbodydescription>
- </inbodydescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="16" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.cc" bodystart="17" bodyend="19"/>
- </memberdef>
- </sectiondef>
- <briefdescription>
-<para>Models the mammal <ref refid="classAadvark" kindref="compound">Aadvark</ref>. </para> </briefdescription>
- <detaileddescription>
-<para>Sadly the model is incomplete and cannot capture all aspects of an aadvark yet.</para><para>This line is uninformative and is only to test line breaks in the comments. </para> </detaileddescription>
- <location file="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" line="10" bodyfile="/home/ben/gnuradio/gnuradio-core/src/python/gnuradio/utils/doxyxml/example/aadvark.h" bodystart="10" bodyend="19"/>
- <listofallmembers>
- <member refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" prot="public" virt="non-virtual"><scope>Aadvark</scope><name>Aadvark</name></member>
- <member refid="classAadvark_1ab79eb58d7bb9d5ddfa5d6f783836cab9" prot="private" virt="non-virtual"><scope>Aadvark</scope><name>aadvarkness</name></member>
- <member refid="classAadvark_1affd2ada0a85807efcbe26615a848f53e" prot="public" virt="non-virtual"><scope>Aadvark</scope><name>get_aadvarkness</name></member>
- <member refid="classAadvark_1abd061aa5f998002e72080a34f512a059" prot="public" virt="non-virtual"><scope>Aadvark</scope><name>print</name></member>
- </listofallmembers>
- </compounddef>
-</doxygen>
diff --git a/docs/doxygen/doxyxml/example/xml/combine.xslt b/docs/doxygen/doxyxml/example/xml/combine.xslt
deleted file mode 100644
index 6de203a..0000000
--- a/docs/doxygen/doxyxml/example/xml/combine.xslt
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- XSLT script to combine the generated output into a single file.
- If you have xsltproc you could use:
- xsltproc combine.xslt index.xml >all.xml
--->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml" version="1.0" indent="yes" standalone="yes" />
- <xsl:template match="/">
- <doxygen version="{doxygenindex/@version}">
- <!-- Load all doxgen generated xml files -->
- <xsl:for-each select="doxygenindex/compound">
- <xsl:copy-of select="document( concat( @refid, '.xml' ) )/doxygen/*" />
- </xsl:for-each>
- </doxygen>
- </xsl:template>
-</xsl:stylesheet>
diff --git a/docs/doxygen/doxyxml/example/xml/compound.xsd b/docs/doxygen/doxyxml/example/xml/compound.xsd
deleted file mode 100644
index 5bb5670..0000000
--- a/docs/doxygen/doxyxml/example/xml/compound.xsd
+++ /dev/null
@@ -1,814 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="doxygen" type="DoxygenType"/>
-
- <!-- Complex types -->
-
- <xsd:complexType name="DoxygenType">
- <xsd:sequence maxOccurs="unbounded">
- <xsd:element name="compounddef" type="compounddefType" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="version" type="DoxVersionNumber" use="required" />
- </xsd:complexType>
-
- <xsd:complexType name="compounddefType">
- <xsd:sequence>
- <xsd:element name="compoundname" type="xsd:string"/>
- <xsd:element name="title" type="xsd:string" minOccurs="0" />
- <xsd:element name="basecompoundref" type="compoundRefType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="derivedcompoundref" type="compoundRefType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="includes" type="incType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="includedby" type="incType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="incdepgraph" type="graphType" minOccurs="0" />
- <xsd:element name="invincdepgraph" type="graphType" minOccurs="0" />
- <xsd:element name="innerdir" type="refType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="innerfile" type="refType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="innerclass" type="refType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="innernamespace" type="refType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="innerpage" type="refType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="innergroup" type="refType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="templateparamlist" type="templateparamlistType" minOccurs="0" />
- <xsd:element name="sectiondef" type="sectiondefType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
- <xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
- <xsd:element name="inheritancegraph" type="graphType" minOccurs="0" />
- <xsd:element name="collaborationgraph" type="graphType" minOccurs="0" />
- <xsd:element name="programlisting" type="listingType" minOccurs="0" />
- <xsd:element name="location" type="locationType" minOccurs="0" />
- <xsd:element name="listofallmembers" type="listofallmembersType" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- <xsd:attribute name="kind" type="DoxCompoundKind" />
- <xsd:attribute name="prot" type="DoxProtectionKind" />
- </xsd:complexType>
-
- <xsd:complexType name="listofallmembersType">
- <xsd:sequence>
- <xsd:element name="member" type="memberRefType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="memberRefType">
- <xsd:sequence>
- <xsd:element name="scope" />
- <xsd:element name="name" />
- </xsd:sequence>
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="prot" type="DoxProtectionKind" />
- <xsd:attribute name="virt" type="DoxVirtualKind" />
- <xsd:attribute name="ambiguityscope" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="compoundRefType" mixed="true">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="refid" type="xsd:string" use="optional" />
- <xsd:attribute name="prot" type="DoxProtectionKind" />
- <xsd:attribute name="virt" type="DoxVirtualKind" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="reimplementType" mixed="true">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="refid" type="xsd:string" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="incType" mixed="true">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="local" type="DoxBool" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="refType" mixed="true">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="prot" type="DoxProtectionKind" use="optional"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="refTextType" mixed="true">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="kindref" type="DoxRefKind" />
- <xsd:attribute name="external" type="xsd:string" use="optional"/>
- <xsd:attribute name="tooltip" type="xsd:string" use="optional"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="sectiondefType">
- <xsd:sequence>
- <xsd:element name="header" type="xsd:string" minOccurs="0" />
- <xsd:element name="description" type="descriptionType" minOccurs="0" />
- <xsd:element name="memberdef" type="memberdefType" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="kind" type="DoxSectionKind" />
- </xsd:complexType>
-
- <xsd:complexType name="memberdefType">
- <xsd:sequence>
- <xsd:element name="templateparamlist" type="templateparamlistType" minOccurs="0" />
- <xsd:element name="type" type="linkedTextType" minOccurs="0" />
- <xsd:element name="definition" minOccurs="0" />
- <xsd:element name="argsstring" minOccurs="0" />
- <xsd:element name="name" />
- <xsd:element name="read" minOccurs="0" />
- <xsd:element name="write" minOccurs="0" />
- <xsd:element name="bitfield" minOccurs="0" />
- <xsd:element name="reimplements" type="reimplementType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="reimplementedby" type="reimplementType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="enumvalue" type="enumvalueType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="initializer" type="linkedTextType" minOccurs="0" />
- <xsd:element name="exceptions" type="linkedTextType" minOccurs="0" />
- <xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
- <xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
- <xsd:element name="inbodydescription" type="descriptionType" minOccurs="0" />
- <xsd:element name="location" type="locationType" />
- <xsd:element name="references" type="referenceType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="referencedby" type="referenceType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="kind" type="DoxMemberKind" />
- <xsd:attribute name="id" type="xsd:string" />
- <xsd:attribute name="prot" type="DoxProtectionKind" />
- <xsd:attribute name="static" type="DoxBool" />
- <xsd:attribute name="const" type="DoxBool" />
- <xsd:attribute name="explicit" type="DoxBool" />
- <xsd:attribute name="inline" type="DoxBool" />
- <xsd:attribute name="virt" type="DoxVirtualKind" />
- <xsd:attribute name="volatile" type="DoxBool" />
- <xsd:attribute name="mutable" type="DoxBool" />
- <!-- Qt property -->
- <xsd:attribute name="readable" type="DoxBool" use="optional"/>
- <xsd:attribute name="writable" type="DoxBool" use="optional"/>
- <!-- C++/CLI variable -->
- <xsd:attribute name="initonly" type="DoxBool" use="optional"/>
- <!-- C++/CLI and C# property -->
- <xsd:attribute name="settable" type="DoxBool" use="optional"/>
- <xsd:attribute name="gettable" type="DoxBool" use="optional"/>
- <!-- C++/CLI function -->
- <xsd:attribute name="final" type="DoxBool" use="optional"/>
- <xsd:attribute name="sealed" type="DoxBool" use="optional"/>
- <xsd:attribute name="new" type="DoxBool" use="optional"/>
- <!-- C++/CLI event -->
- <xsd:attribute name="add" type="DoxBool" use="optional"/>
- <xsd:attribute name="remove" type="DoxBool" use="optional"/>
- <xsd:attribute name="raise" type="DoxBool" use="optional"/>
- <!-- Objective-C 2.0 protocol method -->
- <xsd:attribute name="optional" type="DoxBool" use="optional"/>
- <xsd:attribute name="required" type="DoxBool" use="optional"/>
- <!-- Objective-C 2.0 property accessor -->
- <xsd:attribute name="accessor" type="DoxAccessor" use="optional"/>
- </xsd:complexType>
-
- <xsd:complexType name="descriptionType" mixed="true">
- <xsd:sequence>
- <xsd:element name="title" type="xsd:string" minOccurs="0"/>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect1" type="docSect1Type" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="internal" type="docInternalType" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="enumvalueType" mixed="true">
- <xsd:sequence>
- <xsd:element name="name" />
- <xsd:element name="initializer" type="linkedTextType" minOccurs="0" />
- <xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
- <xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- <xsd:attribute name="prot" type="DoxProtectionKind" />
- </xsd:complexType>
-
- <xsd:complexType name="templateparamlistType">
- <xsd:sequence>
- <xsd:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="paramType">
- <xsd:sequence>
- <xsd:element name="type" type="linkedTextType" minOccurs="0" />
- <xsd:element name="declname" minOccurs="0" />
- <xsd:element name="defname" minOccurs="0" />
- <xsd:element name="array" minOccurs="0" />
- <xsd:element name="defval" type="linkedTextType" minOccurs="0" />
- <xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="linkedTextType" mixed="true">
- <xsd:sequence>
- <xsd:element name="ref" type="refTextType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="graphType">
- <xsd:sequence>
- <xsd:element name="node" type="nodeType" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="nodeType">
- <xsd:sequence>
- <xsd:element name="label" />
- <xsd:element name="link" type="linkType" minOccurs="0" />
- <xsd:element name="childnode" type="childnodeType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="childnodeType">
- <xsd:sequence>
- <xsd:element name="edgelabel" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="relation" type="DoxGraphRelation" />
- </xsd:complexType>
-
- <xsd:complexType name="linkType">
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="external" type="xsd:string" use="optional"/>
- </xsd:complexType>
-
- <xsd:complexType name="listingType">
- <xsd:sequence>
- <xsd:element name="codeline" type="codelineType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="codelineType">
- <xsd:sequence>
- <xsd:element name="highlight" type="highlightType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="lineno" type="xsd:integer" />
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="refkind" type="DoxRefKind" />
- <xsd:attribute name="external" type="DoxBool" />
- </xsd:complexType>
-
- <xsd:complexType name="highlightType" mixed="true">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="sp" />
- <xsd:element name="ref" type="refTextType" />
- </xsd:choice>
- <xsd:attribute name="class" type="DoxHighlightClass" />
- </xsd:complexType>
-
- <xsd:complexType name="referenceType" mixed="true">
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="compoundref" type="xsd:string" use="optional" />
- <xsd:attribute name="startline" type="xsd:integer" />
- <xsd:attribute name="endline" type="xsd:integer" />
- </xsd:complexType>
-
- <xsd:complexType name="locationType">
- <xsd:attribute name="file" type="xsd:string" />
- <xsd:attribute name="line" type="xsd:integer" />
- <xsd:attribute name="bodyfile" type="xsd:string" />
- <xsd:attribute name="bodystart" type="xsd:integer" />
- <xsd:attribute name="bodyend" type="xsd:integer" />
- </xsd:complexType>
-
- <xsd:complexType name="docSect1Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="title" type="xsd:string" />
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect2" type="docSect2Type" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="internal" type="docInternalS1Type" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docSect2Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="title" type="xsd:string" />
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect3" type="docSect3Type" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="internal" type="docInternalS2Type" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docSect3Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="title" type="xsd:string" />
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect4" type="docSect4Type" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="internal" type="docInternalS3Type" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docSect4Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="title" type="xsd:string" />
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="internal" type="docInternalS4Type" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docInternalType" mixed="true">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect1" type="docSect1Type" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docInternalS1Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect2" type="docSect2Type" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docInternalS2Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect3" type="docSect3Type" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docInternalS3Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect3" type="docSect4Type" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docInternalS4Type" mixed="true">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:group name="docTitleCmdGroup">
- <xsd:choice>
- <xsd:element name="ulink" type="docURLLink" />
- <xsd:element name="bold" type="docMarkupType" />
- <xsd:element name="emphasis" type="docMarkupType" />
- <xsd:element name="computeroutput" type="docMarkupType" />
- <xsd:element name="subscript" type="docMarkupType" />
- <xsd:element name="superscript" type="docMarkupType" />
- <xsd:element name="center" type="docMarkupType" />
- <xsd:element name="small" type="docMarkupType" />
- <xsd:element name="htmlonly" type="xsd:string" />
- <xsd:element name="latexonly" type="xsd:string" />
- <xsd:element name="dot" type="xsd:string" />
- <xsd:element name="anchor" type="docAnchorType" />
- <xsd:element name="formula" type="docFormulaType" />
- <xsd:element name="ref" type="docRefTextType" />
- <xsd:element name="copy" type="docEmptyType" />
- <xsd:element name="trademark" type="docEmptyType" />
- <xsd:element name="registered" type="docEmptyType" />
- <xsd:element name="lsquo" type="docEmptyType" />
- <xsd:element name="rsquo" type="docEmptyType" />
- <xsd:element name="ldquo" type="docEmptyType" />
- <xsd:element name="rdquo" type="docEmptyType" />
- <xsd:element name="ndash" type="docEmptyType" />
- <xsd:element name="mdash" type="docEmptyType" />
- <xsd:element name="umlaut" type="docCharType" />
- <xsd:element name="acute" type="docCharType" />
- <xsd:element name="grave" type="docCharType" />
- <xsd:element name="circ" type="docCharType" />
- <xsd:element name="slash" type="docCharType" />
- <xsd:element name="tilde" type="docCharType" />
- <xsd:element name="cedil" type="docCharType" />
- <xsd:element name="ring" type="docCharType" />
- <xsd:element name="szlig" type="docEmptyType" />
- <xsd:element name="nonbreakablespace" type="docEmptyType" />
- </xsd:choice>
- </xsd:group>
-
- <xsd:complexType name="docTitleType" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- </xsd:complexType>
-
- <xsd:group name="docCmdGroup">
- <xsd:choice>
- <xsd:group ref="docTitleCmdGroup"/>
- <xsd:element name="linebreak" type="docEmptyType" />
- <xsd:element name="hruler" type="docEmptyType" />
- <xsd:element name="preformatted" type="docMarkupType" />
- <xsd:element name="programlisting" type="listingType" />
- <xsd:element name="verbatim" type="xsd:string" />
- <xsd:element name="indexentry" type="docIndexEntryType" />
- <xsd:element name="orderedlist" type="docListType" />
- <xsd:element name="itemizedlist" type="docListType" />
- <xsd:element name="simplesect" type="docSimpleSectType" />
- <xsd:element name="title" type="docTitleType" />
- <xsd:element name="variablelist" type="docVariableListType" />
- <xsd:element name="table" type="docTableType" />
- <xsd:element name="heading" type="docHeadingType" />
- <xsd:element name="image" type="docImageType" />
- <xsd:element name="dotfile" type="docDotFileType" />
- <xsd:element name="toclist" type="docTocListType" />
- <xsd:element name="language" type="docLanguageType" />
- <xsd:element name="parameterlist" type="docParamListType" />
- <xsd:element name="xrefsect" type="docXRefSectType" />
- <xsd:element name="copydoc" type="docCopyType" />
- </xsd:choice>
- </xsd:group>
-
- <xsd:complexType name="docParaType" mixed="true">
- <xsd:group ref="docCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- </xsd:complexType>
-
- <xsd:complexType name="docMarkupType" mixed="true">
- <xsd:group ref="docCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- </xsd:complexType>
-
- <xsd:complexType name="docURLLink" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- <xsd:attribute name="url" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docAnchorType" mixed="true">
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docFormulaType" mixed="true">
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docIndexEntryType">
- <xsd:sequence>
- <xsd:element name="primaryie" type="xsd:string" />
- <xsd:element name="secondaryie" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docListType">
- <xsd:sequence>
- <xsd:element name="listitem" type="docListItemType" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docListItemType">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docSimpleSectType">
- <xsd:sequence>
- <xsd:element name="title" type="docTitleType" minOccurs="0" />
- <xsd:sequence minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="para" type="docParaType" minOccurs="1" maxOccurs="unbounded" />
- <xsd:element name="simplesectsep" type="docEmptyType" minOccurs="0"/>
- </xsd:sequence>
- </xsd:sequence>
- <xsd:attribute name="kind" type="DoxSimpleSectKind" />
- </xsd:complexType>
-
- <xsd:complexType name="docVarListEntryType">
- <xsd:sequence>
- <xsd:element name="term" type="docTitleType" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:group name="docVariableListGroup">
- <xsd:sequence>
- <xsd:element name="varlistentry" type="docVarListEntryType" />
- <xsd:element name="listitem" type="docListItemType" />
- </xsd:sequence>
- </xsd:group>
-
- <xsd:complexType name="docVariableListType">
- <xsd:sequence>
- <xsd:group ref="docVariableListGroup" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docRefTextType" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- <xsd:attribute name="refid" type="xsd:string" />
- <xsd:attribute name="kindref" type="DoxRefKind" />
- <xsd:attribute name="external" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docTableType">
- <xsd:sequence>
- <xsd:element name="row" type="docRowType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="caption" type="docCaptionType" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="rows" type="xsd:integer" />
- <xsd:attribute name="cols" type="xsd:integer" />
- </xsd:complexType>
-
- <xsd:complexType name="docRowType">
- <xsd:sequence>
- <xsd:element name="entry" type="docEntryType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docEntryType">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="thead" type="DoxBool" />
- </xsd:complexType>
-
- <xsd:complexType name="docCaptionType" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- </xsd:complexType>
-
- <xsd:complexType name="docHeadingType" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- <xsd:attribute name="level" type="xsd:integer" /> <!-- todo: range 1-6 -->
- </xsd:complexType>
-
- <xsd:complexType name="docImageType" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- <xsd:attribute name="type" type="DoxImageKind" />
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="width" type="xsd:string" />
- <xsd:attribute name="height" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docDotFileType" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docTocItemType" mixed="true">
- <xsd:group ref="docTitleCmdGroup" minOccurs="0" maxOccurs="unbounded" />
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docTocListType">
- <xsd:sequence>
- <xsd:element name="tocitem" type="docTocItemType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docLanguageType">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="langid" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docParamListType">
- <xsd:sequence>
- <xsd:element name="parameteritem" type="docParamListItem" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="kind" type="DoxParamListKind" />
- </xsd:complexType>
-
- <xsd:complexType name="docParamListItem">
- <xsd:sequence>
- <xsd:element name="parameternamelist" type="docParamNameList" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="parameterdescription" type="descriptionType" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docParamNameList">
- <xsd:sequence>
- <xsd:element name="parametername" type="docParamName" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="docParamName" mixed="true">
- <xsd:sequence>
- <xsd:element name="ref" type="refTextType" minOccurs="0" maxOccurs="1" />
- </xsd:sequence>
- <xsd:attribute name="direction" type="DoxParamDir" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="docXRefSectType">
- <xsd:sequence>
- <xsd:element name="xreftitle" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="xrefdescription" type="descriptionType" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docCopyType">
- <xsd:sequence>
- <xsd:element name="para" type="docParaType" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="sect1" type="docSect1Type" minOccurs="0" maxOccurs="unbounded" />
- <xsd:element name="internal" type="docInternalType" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="link" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:complexType name="docCharType">
- <xsd:attribute name="char" type="DoxCharRange"/>
- </xsd:complexType>
-
- <xsd:complexType name="docEmptyType"/>
-
- <!-- Simple types -->
-
- <xsd:simpleType name="DoxBool">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="yes" />
- <xsd:enumeration value="no" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxGraphRelation">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="include" />
- <xsd:enumeration value="usage" />
- <xsd:enumeration value="template-instance" />
- <xsd:enumeration value="public-inheritance" />
- <xsd:enumeration value="protected-inheritance" />
- <xsd:enumeration value="private-inheritance" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxRefKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="compound" />
- <xsd:enumeration value="member" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxMemberKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="define" />
- <xsd:enumeration value="property" />
- <xsd:enumeration value="event" />
- <xsd:enumeration value="variable" />
- <xsd:enumeration value="typedef" />
- <xsd:enumeration value="enum" />
- <xsd:enumeration value="function" />
- <xsd:enumeration value="signal" />
- <xsd:enumeration value="prototype" />
- <xsd:enumeration value="friend" />
- <xsd:enumeration value="dcop" />
- <xsd:enumeration value="slot" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxProtectionKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="public" />
- <xsd:enumeration value="protected" />
- <xsd:enumeration value="private" />
- <xsd:enumeration value="package" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxVirtualKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="non-virtual" />
- <xsd:enumeration value="virtual" />
- <xsd:enumeration value="pure-virtual" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxCompoundKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="class" />
- <xsd:enumeration value="struct" />
- <xsd:enumeration value="union" />
- <xsd:enumeration value="interface" />
- <xsd:enumeration value="protocol" />
- <xsd:enumeration value="category" />
- <xsd:enumeration value="exception" />
- <xsd:enumeration value="file" />
- <xsd:enumeration value="namespace" />
- <xsd:enumeration value="group" />
- <xsd:enumeration value="page" />
- <xsd:enumeration value="example" />
- <xsd:enumeration value="dir" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxSectionKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="user-defined" />
- <xsd:enumeration value="public-type" />
- <xsd:enumeration value="public-func" />
- <xsd:enumeration value="public-attrib" />
- <xsd:enumeration value="public-slot" />
- <xsd:enumeration value="signal" />
- <xsd:enumeration value="dcop-func" />
- <xsd:enumeration value="property" />
- <xsd:enumeration value="event" />
- <xsd:enumeration value="public-static-func" />
- <xsd:enumeration value="public-static-attrib" />
- <xsd:enumeration value="protected-type" />
- <xsd:enumeration value="protected-func" />
- <xsd:enumeration value="protected-attrib" />
- <xsd:enumeration value="protected-slot" />
- <xsd:enumeration value="protected-static-func" />
- <xsd:enumeration value="protected-static-attrib" />
- <xsd:enumeration value="package-type" />
- <xsd:enumeration value="package-func" />
- <xsd:enumeration value="package-attrib" />
- <xsd:enumeration value="package-static-func" />
- <xsd:enumeration value="package-static-attrib" />
- <xsd:enumeration value="private-type" />
- <xsd:enumeration value="private-func" />
- <xsd:enumeration value="private-attrib" />
- <xsd:enumeration value="private-slot" />
- <xsd:enumeration value="private-static-func" />
- <xsd:enumeration value="private-static-attrib" />
- <xsd:enumeration value="friend" />
- <xsd:enumeration value="related" />
- <xsd:enumeration value="define" />
- <xsd:enumeration value="prototype" />
- <xsd:enumeration value="typedef" />
- <xsd:enumeration value="enum" />
- <xsd:enumeration value="func" />
- <xsd:enumeration value="var" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxHighlightClass">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="comment" />
- <xsd:enumeration value="normal" />
- <xsd:enumeration value="preprocessor" />
- <xsd:enumeration value="keyword" />
- <xsd:enumeration value="keywordtype" />
- <xsd:enumeration value="keywordflow" />
- <xsd:enumeration value="stringliteral" />
- <xsd:enumeration value="charliteral" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxSimpleSectKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="see" />
- <xsd:enumeration value="return" />
- <xsd:enumeration value="author" />
- <xsd:enumeration value="authors" />
- <xsd:enumeration value="version" />
- <xsd:enumeration value="since" />
- <xsd:enumeration value="date" />
- <xsd:enumeration value="note" />
- <xsd:enumeration value="warning" />
- <xsd:enumeration value="pre" />
- <xsd:enumeration value="post" />
- <xsd:enumeration value="invariant" />
- <xsd:enumeration value="remark" />
- <xsd:enumeration value="attention" />
- <xsd:enumeration value="par" />
- <xsd:enumeration value="rcs" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxVersionNumber">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="\d+\.\d+.*" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxImageKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="html" />
- <xsd:enumeration value="latex" />
- <xsd:enumeration value="rtf" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxParamListKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="param" />
- <xsd:enumeration value="retval" />
- <xsd:enumeration value="exception" />
- <xsd:enumeration value="templateparam" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxCharRange">
- <xsd:restriction base="xsd:string">
- <xsd:pattern value="[aeiouncAEIOUNC]" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxParamDir">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="in"/>
- <xsd:enumeration value="out"/>
- <xsd:enumeration value="inout"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="DoxAccessor">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="retain"/>
- <xsd:enumeration value="copy"/>
- <xsd:enumeration value="assign"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema>
-
diff --git a/docs/doxygen/doxyxml/example/xml/index.xml b/docs/doxygen/doxyxml/example/xml/index.xml
deleted file mode 100644
index 13fd53f..0000000
--- a/docs/doxygen/doxyxml/example/xml/index.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='no'?>
-<doxygenindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="index.xsd" version="1.6.3">
- <compound refid="classAadvark" kind="class"><name>Aadvark</name>
- <member refid="classAadvark_1ab79eb58d7bb9d5ddfa5d6f783836cab9" kind="variable"><name>aadvarkness</name></member>
- <member refid="classAadvark_1abd061aa5f998002e72080a34f512a059" kind="function"><name>print</name></member>
- <member refid="classAadvark_1adf1a4b97a641411a74a04ab312484462" kind="function"><name>Aadvark</name></member>
- <member refid="classAadvark_1affd2ada0a85807efcbe26615a848f53e" kind="function"><name>get_aadvarkness</name></member>
- </compound>
- <compound refid="aadvark_8cc" kind="file"><name>aadvark.cc</name>
- <member refid="aadvark_8cc_1acb52858524210ec6dddc3e16d1e52946" kind="function"><name>aadvarky_enough</name></member>
- <member refid="aadvark_8cc_1ae66f6b31b5ad750f1fe042a706a4e3d4" kind="function"><name>main</name></member>
- </compound>
- <compound refid="aadvark_8h" kind="file"><name>aadvark.h</name>
- <member refid="aadvark_8h_1acb52858524210ec6dddc3e16d1e52946" kind="function"><name>aadvarky_enough</name></member>
- <member refid="aadvark_8h_1ae66f6b31b5ad750f1fe042a706a4e3d4" kind="function"><name>main</name></member>
- </compound>
-</doxygenindex>
diff --git a/docs/doxygen/doxyxml/example/xml/index.xsd b/docs/doxygen/doxyxml/example/xml/index.xsd
deleted file mode 100644
index bfe960c..0000000
--- a/docs/doxygen/doxyxml/example/xml/index.xsd
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:element name="doxygenindex" type="DoxygenType"/>
-
- <xsd:complexType name="DoxygenType">
- <xsd:sequence>
- <xsd:element name="compound" type="CompoundType" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <xsd:complexType name="CompoundType">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="member" type="MemberType" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="refid" type="xsd:string" use="required"/>
- <xsd:attribute name="kind" type="CompoundKind" use="required"/>
- </xsd:complexType>
-
- <xsd:complexType name="MemberType">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- </xsd:sequence>
- <xsd:attribute name="refid" type="xsd:string" use="required"/>
- <xsd:attribute name="kind" type="MemberKind" use="required"/>
- </xsd:complexType>
-
- <xsd:simpleType name="CompoundKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="class"/>
- <xsd:enumeration value="struct"/>
- <xsd:enumeration value="union"/>
- <xsd:enumeration value="interface"/>
- <xsd:enumeration value="protocol"/>
- <xsd:enumeration value="category"/>
- <xsd:enumeration value="exception"/>
- <xsd:enumeration value="file"/>
- <xsd:enumeration value="namespace"/>
- <xsd:enumeration value="group"/>
- <xsd:enumeration value="page"/>
- <xsd:enumeration value="example"/>
- <xsd:enumeration value="dir"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="MemberKind">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="define"/>
- <xsd:enumeration value="property"/>
- <xsd:enumeration value="event"/>
- <xsd:enumeration value="variable"/>
- <xsd:enumeration value="typedef"/>
- <xsd:enumeration value="enum"/>
- <xsd:enumeration value="enumvalue"/>
- <xsd:enumeration value="function"/>
- <xsd:enumeration value="signal"/>
- <xsd:enumeration value="prototype"/>
- <xsd:enumeration value="friend"/>
- <xsd:enumeration value="dcop"/>
- <xsd:enumeration value="slot"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema>
-
diff --git a/docs/doxygen/doxyxml/generated/__init__.py b/docs/doxygen/doxyxml/generated/__init__.py
index 3982397..23095c1 100644
--- a/docs/doxygen/doxyxml/generated/__init__.py
+++ b/docs/doxygen/doxyxml/generated/__init__.py
@@ -5,3 +5,4 @@ These do the real work of parsing the doxygen xml files but the
resultant classes are not very friendly to navigate so the rest of the
doxyxml module processes them further.
"""
+from __future__ import unicode_literals
diff --git a/docs/doxygen/doxyxml/generated/compound.py b/docs/doxygen/doxyxml/generated/compound.py
index 1522ac2..acfa0dd 100644
--- a/docs/doxygen/doxyxml/generated/compound.py
+++ b/docs/doxygen/doxyxml/generated/compound.py
@@ -3,15 +3,17 @@
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
+
-from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
import sys
-import compoundsuper as supermod
-from compoundsuper import MixedContainer
+from . import compoundsuper as supermod
+from .compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
diff --git a/docs/doxygen/doxyxml/generated/compoundsuper.py b/docs/doxygen/doxyxml/generated/compoundsuper.py
index 6255dda..6e984e1 100644
--- a/docs/doxygen/doxyxml/generated/compoundsuper.py
+++ b/docs/doxygen/doxyxml/generated/compoundsuper.py
@@ -4,12 +4,17 @@
# Generated Thu Jun 11 18:44:25 2009 by generateDS.py.
#
+from __future__ import print_function
+from __future__ import unicode_literals
+
import sys
-import getopt
-from string import lower as str_lower
+
from xml.dom import minidom
from xml.dom import Node
+import six
+
+
#
# User methods
#
@@ -19,9 +24,9 @@ from xml.dom import Node
try:
from generatedssuper import GeneratedsSuper
-except ImportError, exp:
+except ImportError as exp:
- class GeneratedsSuper:
+ class GeneratedsSuper(object):
def format_string(self, input_data, input_name=''):
return input_data
def format_integer(self, input_data, input_name=''):
@@ -64,7 +69,7 @@ def showIndent(outfile, level):
outfile.write(' ')
def quote_xml(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
@@ -72,7 +77,7 @@ def quote_xml(inStr):
return s1
def quote_attrib(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
@@ -102,7 +107,7 @@ def quote_python(inStr):
return '"""%s"""' % s1
-class MixedContainer:
+class MixedContainer(object):
# Constants for category:
CategoryNone = 0
CategoryText = 1
@@ -4221,7 +4226,7 @@ class codelineType(GeneratedsSuper):
if attrs.get('lineno'):
try:
self.lineno = int(attrs.get('lineno').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (lineno): %s' % exp)
if attrs.get('refkind'):
self.refkind = attrs.get('refkind').value
@@ -4504,12 +4509,12 @@ class referenceType(GeneratedsSuper):
if attrs.get('endline'):
try:
self.endline = int(attrs.get('endline').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (endline): %s' % exp)
if attrs.get('startline'):
try:
self.startline = int(attrs.get('startline').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (startline): %s' % exp)
if attrs.get('refid'):
self.refid = attrs.get('refid').value
@@ -4627,17 +4632,17 @@ class locationType(GeneratedsSuper):
if attrs.get('bodystart'):
try:
self.bodystart = int(attrs.get('bodystart').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (bodystart): %s' % exp)
if attrs.get('line'):
try:
self.line = int(attrs.get('line').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (line): %s' % exp)
if attrs.get('bodyend'):
try:
self.bodyend = int(attrs.get('bodyend').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (bodyend): %s' % exp)
if attrs.get('bodyfile'):
self.bodyfile = attrs.get('bodyfile').value
@@ -6778,12 +6783,12 @@ class docTableType(GeneratedsSuper):
if attrs.get('rows'):
try:
self.rows = int(attrs.get('rows').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (rows): %s' % exp)
if attrs.get('cols'):
try:
self.cols = int(attrs.get('cols').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (cols): %s' % exp)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
@@ -7108,7 +7113,7 @@ class docHeadingType(GeneratedsSuper):
if attrs.get('level'):
try:
self.level = int(attrs.get('level').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (level): %s' % exp)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
@@ -8283,7 +8288,7 @@ Options:
"""
def usage():
- print USAGE_TEXT
+ print(USAGE_TEXT)
sys.exit(1)
@@ -8339,4 +8344,3 @@ if __name__ == '__main__':
main()
#import pdb
#pdb.run('main()')
-
diff --git a/docs/doxygen/doxyxml/generated/index.py b/docs/doxygen/doxyxml/generated/index.py
index 7a70e14..0c63512 100644
--- a/docs/doxygen/doxyxml/generated/index.py
+++ b/docs/doxygen/doxyxml/generated/index.py
@@ -3,14 +3,16 @@
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
from xml.dom import minidom
import os
import sys
-import compound
+from . import compound
-import indexsuper as supermod
+from . import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
diff --git a/docs/doxygen/doxyxml/generated/indexsuper.py b/docs/doxygen/doxyxml/generated/indexsuper.py
index a991530..11312db 100644
--- a/docs/doxygen/doxyxml/generated/indexsuper.py
+++ b/docs/doxygen/doxyxml/generated/indexsuper.py
@@ -4,12 +4,16 @@
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
+from __future__ import print_function
+from __future__ import unicode_literals
+
import sys
-import getopt
-from string import lower as str_lower
+
from xml.dom import minidom
from xml.dom import Node
+import six
+
#
# User methods
#
@@ -19,9 +23,9 @@ from xml.dom import Node
try:
from generatedssuper import GeneratedsSuper
-except ImportError, exp:
+except ImportError as exp:
- class GeneratedsSuper:
+ class GeneratedsSuper(object):
def format_string(self, input_data, input_name=''):
return input_data
def format_integer(self, input_data, input_name=''):
@@ -64,7 +68,7 @@ def showIndent(outfile, level):
outfile.write(' ')
def quote_xml(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
@@ -72,7 +76,7 @@ def quote_xml(inStr):
return s1
def quote_attrib(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
@@ -102,7 +106,7 @@ def quote_python(inStr):
return '"""%s"""' % s1
-class MixedContainer:
+class MixedContainer(object):
# Constants for category:
CategoryNone = 0
CategoryText = 1
@@ -462,7 +466,7 @@ Options:
"""
def usage():
- print USAGE_TEXT
+ print(USAGE_TEXT)
sys.exit(1)
@@ -520,4 +524,3 @@ if __name__ == '__main__':
main()
#import pdb
#pdb.run('main()')
-
diff --git a/docs/doxygen/doxyxml/text.py b/docs/doxygen/doxyxml/text.py
index 629edd1..4c70404 100644
--- a/docs/doxygen/doxyxml/text.py
+++ b/docs/doxygen/doxyxml/text.py
@@ -1,7 +1,8 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gr-osmosdr
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,12 +22,13 @@
"""
Utilities for extracting text from generated classes.
"""
+from __future__ import unicode_literals
def is_string(txt):
if isinstance(txt, str):
return True
try:
- if isinstance(txt, unicode):
+ if isinstance(txt, str):
return True
except NameError:
pass
@@ -49,7 +51,7 @@ def description_bit(obj):
elif is_string(obj):
return obj
else:
- raise StandardError('Expecting a string or something with content, content_ or value attribute')
+ raise Exception('Expecting a string or something with content, content_ or value attribute')
# If this bit is a paragraph then add one some line breaks.
if hasattr(obj, 'name') and obj.name == 'para':
result += "\n\n"
diff --git a/docs/doxygen/other/group_defs.dox b/docs/doxygen/other/group_defs.dox
index 0981128..174edeb 100644
--- a/docs/doxygen/other/group_defs.dox
+++ b/docs/doxygen/other/group_defs.dox
@@ -1,6 +1,7 @@
/*!
- * \defgroup block GNU Radio OsmoSDR C++ Signal Processing Blocks
- * \brief All C++ blocks that can be used from the OsmoSDR GNU Radio
+ * \defgroup block GNU Radio TEST C++ Signal Processing Blocks
+ * \brief All C++ blocks that can be used from the TEST GNU Radio
* module are listed here or in the subcategories below.
*
*/
+
diff --git a/docs/doxygen/other/main_page.dox b/docs/doxygen/other/main_page.dox
index 1e5110b..07b5bc2 100644
--- a/docs/doxygen/other/main_page.dox
+++ b/docs/doxygen/other/main_page.dox
@@ -1,5 +1,10 @@
/*! \mainpage
-Welcome to the OsmoSDR GNUradio blocks
+Welcome to the GNU Radio TEST Block
+
+This is the intro page for the Doxygen manual generated for the TEST
+block (docs/doxygen/other/main_page.dox). Edit it to add more detailed
+documentation about the new GNU Radio modules contained in this
+project.
*/
diff --git a/docs/doxygen/pydoc_macros.h b/docs/doxygen/pydoc_macros.h
new file mode 100644
index 0000000..98bf7cd
--- /dev/null
+++ b/docs/doxygen/pydoc_macros.h
@@ -0,0 +1,19 @@
+#ifndef PYDOC_MACROS_H
+#define PYDOC_MACROS_H
+
+#define __EXPAND(x) x
+#define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT
+#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1))
+#define __CAT1(a, b) a##b
+#define __CAT2(a, b) __CAT1(a, b)
+#define __DOC1(n1) __doc_##n1
+#define __DOC2(n1, n2) __doc_##n1##_##n2
+#define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3
+#define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4
+#define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5
+#define __DOC6(n1, n2, n3, n4, n5, n6) __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6
+#define __DOC7(n1, n2, n3, n4, n5, n6, n7) \
+ __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7
+#define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__))
+
+#endif // PYDOC_MACROS_H \ No newline at end of file
diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py
deleted file mode 100644
index 4e1ce2e..0000000
--- a/docs/doxygen/swig_doc.py
+++ /dev/null
@@ -1,255 +0,0 @@
-#
-# Copyright 2010,2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-"""
-Creates the swig_doc.i SWIG interface file.
-Execute using: python swig_doc.py xml_path outputfilename
-
-The file instructs SWIG to transfer the doxygen comments into the
-python docstrings.
-
-"""
-
-import sys
-
-try:
- from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base
-except ImportError:
- from gnuradio.doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base
-
-
-def py_name(name):
- bits = name.split('_')
- return '_'.join(bits[1:])
-
-def make_name(name):
- bits = name.split('_')
- return bits[0] + '_make_' + '_'.join(bits[1:])
-
-
-class Block(object):
- """
- Checks if doxyxml produced objects correspond to a gnuradio block.
- """
-
- @classmethod
- def includes(cls, item):
- if not isinstance(item, DoxyClass):
- return False
- # Check for a parsing error.
- if item.error():
- return False
- return item.has_member(make_name(item.name()), DoxyFriend)
-
-
-def utoascii(text):
- """
- Convert unicode text into ascii and escape quotes.
- """
- if text is None:
- return ''
- out = text.encode('ascii', 'replace')
- out = out.replace('"', '\\"')
- return out
-
-
-def combine_descriptions(obj):
- """
- Combines the brief and detailed descriptions of an object together.
- """
- description = []
- bd = obj.brief_description.strip()
- dd = obj.detailed_description.strip()
- if bd:
- description.append(bd)
- if dd:
- description.append(dd)
- return utoascii('\n\n'.join(description)).strip()
-
-
-entry_templ = '%feature("docstring") {name} "{docstring}"'
-def make_entry(obj, name=None, templ="{description}", description=None):
- """
- Create a docstring entry for a swig interface file.
-
- obj - a doxyxml object from which documentation will be extracted.
- name - the name of the C object (defaults to obj.name())
- templ - an optional template for the docstring containing only one
- variable named 'description'.
- description - if this optional variable is set then it's value is
- used as the description instead of extracting it from obj.
- """
- if name is None:
- name=obj.name()
- if "operator " in name:
- return ''
- if description is None:
- description = combine_descriptions(obj)
- docstring = templ.format(description=description)
- if not docstring:
- return ''
- return entry_templ.format(
- name=name,
- docstring=docstring,
- )
-
-
-def make_func_entry(func, name=None, description=None, params=None):
- """
- Create a function docstring entry for a swig interface file.
-
- func - a doxyxml object from which documentation will be extracted.
- name - the name of the C object (defaults to func.name())
- description - if this optional variable is set then it's value is
- used as the description instead of extracting it from func.
- params - a parameter list that overrides using func.params.
- """
- if params is None:
- params = func.params
- params = [prm.declname for prm in params]
- if params:
- sig = "Params: (%s)" % ", ".join(params)
- else:
- sig = "Params: (NONE)"
- templ = "{description}\n\n" + sig
- return make_entry(func, name=name, templ=utoascii(templ),
- description=description)
-
-
-def make_class_entry(klass, description=None):
- """
- Create a class docstring for a swig interface file.
- """
- output = []
- output.append(make_entry(klass, description=description))
- for func in klass.in_category(DoxyFunction):
- name = klass.name() + '::' + func.name()
- output.append(make_func_entry(func, name=name))
- return "\n\n".join(output)
-
-
-def make_block_entry(di, block):
- """
- Create class and function docstrings of a gnuradio block for a
- swig interface file.
- """
- descriptions = []
- # Get the documentation associated with the class.
- class_desc = combine_descriptions(block)
- if class_desc:
- descriptions.append(class_desc)
- # Get the documentation associated with the make function
- make_func = di.get_member(make_name(block.name()), DoxyFunction)
- make_func_desc = combine_descriptions(make_func)
- if make_func_desc:
- descriptions.append(make_func_desc)
- # Get the documentation associated with the file
- try:
- block_file = di.get_member(block.name() + ".h", DoxyFile)
- file_desc = combine_descriptions(block_file)
- if file_desc:
- descriptions.append(file_desc)
- except base.Base.NoSuchMember:
- # Don't worry if we can't find a matching file.
- pass
- # And join them all together to make a super duper description.
- super_description = "\n\n".join(descriptions)
- # Associate the combined description with the class and
- # the make function.
- output = []
- output.append(make_class_entry(block, description=super_description))
- creator = block.get_member(block.name(), DoxyFunction)
- output.append(make_func_entry(make_func, description=super_description,
- params=creator.params))
- return "\n\n".join(output)
-
-
-def make_swig_interface_file(di, swigdocfilename, custom_output=None):
-
- output = ["""
-/*
- * This file was automatically generated using swig_doc.py.
- *
- * Any changes to it will be lost next time it is regenerated.
- */
-"""]
-
- if custom_output is not None:
- output.append(custom_output)
-
- # Create docstrings for the blocks.
- blocks = di.in_category(Block)
- make_funcs = set([])
- for block in blocks:
- try:
- make_func = di.get_member(make_name(block.name()), DoxyFunction)
- make_funcs.add(make_func.name())
- output.append(make_block_entry(di, block))
- except block.ParsingError:
- print('Parsing error for block %s' % block.name())
-
- # Create docstrings for functions
- # Don't include the make functions since they have already been dealt with.
- funcs = [f for f in di.in_category(DoxyFunction) if f.name() not in make_funcs]
- for f in funcs:
- try:
- output.append(make_func_entry(f))
- except f.ParsingError:
- print('Parsing error for function %s' % f.name())
-
- # Create docstrings for classes
- block_names = [block.name() for block in blocks]
- klasses = [k for k in di.in_category(DoxyClass) if k.name() not in block_names]
- for k in klasses:
- try:
- output.append(make_class_entry(k))
- except k.ParsingError:
- print('Parsing error for class %s' % k.name())
-
- # Docstrings are not created for anything that is not a function or a class.
- # If this excludes anything important please add it here.
-
- output = "\n\n".join(output)
-
- swig_doc = file(swigdocfilename, 'w')
- swig_doc.write(output)
- swig_doc.close()
-
-if __name__ == "__main__":
- # Parse command line options and set up doxyxml.
- err_msg = "Execute using: python swig_doc.py xml_path outputfilename"
- if len(sys.argv) != 3:
- raise StandardError(err_msg)
- xml_path = sys.argv[1]
- swigdocfilename = sys.argv[2]
- di = DoxyIndex(xml_path)
-
- # gnuradio.gr.msq_queue.insert_tail and delete_head create errors unless docstrings are defined!
- # This is presumably a bug in SWIG.
- #msg_q = di.get_member(u'gr_msg_queue', DoxyClass)
- #insert_tail = msg_q.get_member(u'insert_tail', DoxyFunction)
- #delete_head = msg_q.get_member(u'delete_head', DoxyFunction)
- output = []
- #output.append(make_func_entry(insert_tail, name='gr_py_msg_queue__insert_tail'))
- #output.append(make_func_entry(delete_head, name='gr_py_msg_queue__delete_head'))
- custom_output = "\n\n".join(output)
-
- # Generate the docstrings interface file.
- make_swig_interface_file(di, swigdocfilename, custom_output=custom_output)
diff --git a/docs/doxygen/update_pydoc.py b/docs/doxygen/update_pydoc.py
new file mode 100644
index 0000000..e6b4544
--- /dev/null
+++ b/docs/doxygen/update_pydoc.py
@@ -0,0 +1,346 @@
+#
+# Copyright 2010-2012 Free Software Foundation, Inc.
+#
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gnuradio
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+#
+"""
+Updates the *pydoc_h files for a module
+Execute using: python update_pydoc.py xml_path outputfilename
+
+The file instructs Pybind11 to transfer the doxygen comments into the
+python docstrings.
+
+"""
+
+import os, sys, time, glob, re, json
+from argparse import ArgumentParser
+
+from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile
+from doxyxml import DoxyOther, base
+
+def py_name(name):
+ bits = name.split('_')
+ return '_'.join(bits[1:])
+
+def make_name(name):
+ bits = name.split('_')
+ return bits[0] + '_make_' + '_'.join(bits[1:])
+
+
+class Block(object):
+ """
+ Checks if doxyxml produced objects correspond to a gnuradio block.
+ """
+
+ @classmethod
+ def includes(cls, item):
+ if not isinstance(item, DoxyClass):
+ return False
+ # Check for a parsing error.
+ if item.error():
+ return False
+ friendname = make_name(item.name())
+ is_a_block = item.has_member(friendname, DoxyFriend)
+ # But now sometimes the make function isn't a friend so check again.
+ if not is_a_block:
+ is_a_block = di.has_member(friendname, DoxyFunction)
+ return is_a_block
+
+class Block2(object):
+ """
+ Checks if doxyxml produced objects correspond to a new style
+ gnuradio block.
+ """
+
+ @classmethod
+ def includes(cls, item):
+ if not isinstance(item, DoxyClass):
+ return False
+ # Check for a parsing error.
+ if item.error():
+ return False
+ is_a_block2 = item.has_member('make', DoxyFunction) and item.has_member('sptr', DoxyOther)
+ return is_a_block2
+
+
+def utoascii(text):
+ """
+ Convert unicode text into ascii and escape quotes and backslashes.
+ """
+ if text is None:
+ return ''
+ out = text.encode('ascii', 'replace')
+ # swig will require us to replace blackslash with 4 backslashes
+ # TODO: evaluate what this should be for pybind11
+ out = out.replace(b'\\', b'\\\\\\\\')
+ out = out.replace(b'"', b'\\"').decode('ascii')
+ return str(out)
+
+
+def combine_descriptions(obj):
+ """
+ Combines the brief and detailed descriptions of an object together.
+ """
+ description = []
+ bd = obj.brief_description.strip()
+ dd = obj.detailed_description.strip()
+ if bd:
+ description.append(bd)
+ if dd:
+ description.append(dd)
+ return utoascii('\n\n'.join(description)).strip()
+
+def format_params(parameteritems):
+ output = ['Args:']
+ template = ' {0} : {1}'
+ for pi in parameteritems:
+ output.append(template.format(pi.name, pi.description))
+ return '\n'.join(output)
+
+entry_templ = '%feature("docstring") {name} "{docstring}"'
+def make_entry(obj, name=None, templ="{description}", description=None, params=[]):
+ """
+ Create a docstring key/value pair, where the key is the object name.
+
+ obj - a doxyxml object from which documentation will be extracted.
+ name - the name of the C object (defaults to obj.name())
+ templ - an optional template for the docstring containing only one
+ variable named 'description'.
+ description - if this optional variable is set then it's value is
+ used as the description instead of extracting it from obj.
+ """
+ if name is None:
+ name=obj.name()
+ if hasattr(obj,'_parse_data') and hasattr(obj._parse_data,'definition'):
+ name=obj._parse_data.definition.split(' ')[-1]
+ if "operator " in name:
+ return ''
+ if description is None:
+ description = combine_descriptions(obj)
+ if params:
+ description += '\n\n'
+ description += utoascii(format_params(params))
+ docstring = templ.format(description=description)
+
+ return {name: docstring}
+
+
+def make_class_entry(klass, description=None, ignored_methods=[], params=None):
+ """
+ Create a class docstring key/value pair.
+ """
+ if params is None:
+ params = klass.params
+ output = {}
+ output.update(make_entry(klass, description=description, params=params))
+ for func in klass.in_category(DoxyFunction):
+ if func.name() not in ignored_methods:
+ name = klass.name() + '::' + func.name()
+ output.update(make_entry(func, name=name))
+ return output
+
+
+def make_block_entry(di, block):
+ """
+ Create class and function docstrings of a gnuradio block
+ """
+ descriptions = []
+ # Get the documentation associated with the class.
+ class_desc = combine_descriptions(block)
+ if class_desc:
+ descriptions.append(class_desc)
+ # Get the documentation associated with the make function
+ make_func = di.get_member(make_name(block.name()), DoxyFunction)
+ make_func_desc = combine_descriptions(make_func)
+ if make_func_desc:
+ descriptions.append(make_func_desc)
+ # Get the documentation associated with the file
+ try:
+ block_file = di.get_member(block.name() + ".h", DoxyFile)
+ file_desc = combine_descriptions(block_file)
+ if file_desc:
+ descriptions.append(file_desc)
+ except base.Base.NoSuchMember:
+ # Don't worry if we can't find a matching file.
+ pass
+ # And join them all together to make a super duper description.
+ super_description = "\n\n".join(descriptions)
+ # Associate the combined description with the class and
+ # the make function.
+ output = {}
+ output.update(make_class_entry(block, description=super_description))
+ output.update(make_entry(make_func, description=super_description,
+ params=block.params))
+ return output
+
+def make_block2_entry(di, block):
+ """
+ Create class and function docstrings of a new style gnuradio block
+ """
+ # For new style blocks all the relevant documentation should be
+ # associated with the 'make' method.
+ class_description = combine_descriptions(block)
+ make_func = block.get_member('make', DoxyFunction)
+ make_description = combine_descriptions(make_func)
+ description = class_description + "\n\nConstructor Specific Documentation:\n\n" + make_description
+ # Associate the combined description with the class and
+ # the make function.
+ output = {}
+ output.update(make_class_entry(
+ block, description=description,
+ ignored_methods=['make'], params=make_func.params))
+ makename = block.name() + '::make'
+ output.update(make_entry(
+ make_func, name=makename, description=description,
+ params=make_func.params))
+ return output
+
+def get_docstrings_dict(di, custom_output=None):
+
+ output = {}
+ if custom_output:
+ output.update(custom_output)
+
+ # Create docstrings for the blocks.
+ blocks = di.in_category(Block)
+ blocks2 = di.in_category(Block2)
+
+ make_funcs = set([])
+ for block in blocks:
+ try:
+ make_func = di.get_member(make_name(block.name()), DoxyFunction)
+ # Don't want to risk writing to output twice.
+ if make_func.name() not in make_funcs:
+ make_funcs.add(make_func.name())
+ output.update(make_block_entry(di, block))
+ except block.ParsingError:
+ sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
+ raise
+
+ for block in blocks2:
+ try:
+ make_func = block.get_member('make', DoxyFunction)
+ make_func_name = block.name() +'::make'
+ # Don't want to risk writing to output twice.
+ if make_func_name not in make_funcs:
+ make_funcs.add(make_func_name)
+ output.update(make_block2_entry(di, block))
+ except block.ParsingError:
+ sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
+ raise
+
+ # Create docstrings for functions
+ # Don't include the make functions since they have already been dealt with.
+ funcs = [f for f in di.in_category(DoxyFunction)
+ if f.name() not in make_funcs and not f.name().startswith('std::')]
+ for f in funcs:
+ try:
+ output.update(make_entry(f))
+ except f.ParsingError:
+ sys.stderr.write('Parsing error for function {0}\n'.format(f.name()))
+
+ # Create docstrings for classes
+ block_names = [block.name() for block in blocks]
+ block_names += [block.name() for block in blocks2]
+ klasses = [k for k in di.in_category(DoxyClass)
+ if k.name() not in block_names and not k.name().startswith('std::')]
+ for k in klasses:
+ try:
+ output.update(make_class_entry(k))
+ except k.ParsingError:
+ sys.stderr.write('Parsing error for class {0}\n'.format(k.name()))
+
+ # Docstrings are not created for anything that is not a function or a class.
+ # If this excludes anything important please add it here.
+
+ return output
+
+def sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, output_dir, filter_str=None):
+ if filter_str:
+ docstrings_dict = {k: v for k, v in docstrings_dict.items() if k.startswith(filter_str)}
+
+ with open(os.path.join(output_dir,'docstring_status'),'w') as status_file:
+
+ for pydoc_file in pydoc_files:
+ if filter_str:
+ filter_str2 = "::".join((filter_str,os.path.split(pydoc_file)[-1].split('_pydoc_template.h')[0]))
+ docstrings_dict2 = {k: v for k, v in docstrings_dict.items() if k.startswith(filter_str2)}
+ else:
+ docstrings_dict2 = docstrings_dict
+
+
+
+ file_in = open(pydoc_file,'r').read()
+ for key, value in docstrings_dict2.items():
+ file_in_tmp = file_in
+ try:
+ doc_key = key.split("::")
+ # if 'gr' in doc_key:
+ # doc_key.remove('gr')
+ doc_key = '_'.join(doc_key)
+ regexp = r'(__doc_{} =\sR\"doc\()[^)]*(\)doc\")'.format(doc_key)
+ regexp = re.compile(regexp, re.MULTILINE)
+
+ (file_in, nsubs) = regexp.subn(r'\1'+value+r'\2', file_in, count=1)
+ if nsubs == 1:
+ status_file.write("PASS: " + pydoc_file + "\n")
+ except KeyboardInterrupt:
+ raise KeyboardInterrupt
+ except: # be permissive, TODO log, but just leave the docstring blank
+ status_file.write("FAIL: " + pydoc_file + "\n")
+ file_in = file_in_tmp
+
+ output_pathname = os.path.join(output_dir, os.path.basename(pydoc_file).replace('_template.h','.h'))
+ # FIXME: Remove this debug print
+ print('output docstrings to {}'.format(output_pathname))
+ with open(output_pathname,'w') as file_out:
+ file_out.write(file_in)
+
+def copy_docstring_templates(pydoc_files, output_dir):
+ with open(os.path.join(output_dir,'docstring_status'),'w') as status_file:
+ for pydoc_file in pydoc_files:
+ file_in = open(pydoc_file,'r').read()
+ output_pathname = os.path.join(output_dir, os.path.basename(pydoc_file).replace('_template.h','.h'))
+ # FIXME: Remove this debug print
+ print('copy docstrings to {}'.format(output_pathname))
+ with open(output_pathname,'w') as file_out:
+ file_out.write(file_in)
+ status_file.write("DONE")
+
+def argParse():
+ """Parses commandline args."""
+ desc='Scrape the doxygen generated xml for docstrings to insert into python bindings'
+ parser = ArgumentParser(description=desc)
+
+ parser.add_argument("function", help="Operation to perform on docstrings", choices=["scrape","sub","copy"])
+
+ parser.add_argument("--xml_path")
+ parser.add_argument("--bindings_dir")
+ parser.add_argument("--output_dir")
+ parser.add_argument("--json_path")
+ parser.add_argument("--filter", default=None)
+
+ return parser.parse_args()
+
+if __name__ == "__main__":
+ # Parse command line options and set up doxyxml.
+ args = argParse()
+ if args.function.lower() == 'scrape':
+ di = DoxyIndex(args.xml_path)
+ docstrings_dict = get_docstrings_dict(di)
+ with open(args.json_path, 'w') as fp:
+ json.dump(docstrings_dict, fp)
+ elif args.function.lower() == 'sub':
+ with open(args.json_path, 'r') as fp:
+ docstrings_dict = json.load(fp)
+ pydoc_files = glob.glob(os.path.join(args.bindings_dir,'*_pydoc_template.h'))
+ sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, args.output_dir, args.filter)
+ elif args.function.lower() == 'copy':
+ pydoc_files = glob.glob(os.path.join(args.bindings_dir,'*_pydoc_template.h'))
+ copy_docstring_templates(pydoc_files, args.output_dir)
+
+
diff --git a/gnuradio-osmosdr.pc.in b/gnuradio-osmosdr.pc.in
deleted file mode 100644
index 5f1ae69..0000000
--- a/gnuradio-osmosdr.pc.in
+++ /dev/null
@@ -1,15 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/@GR_LIBRARY_DIR@
-includedir=${prefix}/@GR_INCLUDE_DIR@
-
-Name: @CPACK_PACKAGE_NAME@
-Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
-URL: http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
-Version: @CPACK_PACKAGE_VERSION@
-Requires: gnuradio-runtime gnuradio-blocks
-Requires.private: @GR_OSMOSDR_PC_REQUIRES@
-Conflicts:
-Cflags: -I${includedir} @GR_OSMOSDR_PC_CFLAGS@
-Libs: -L${libdir} -lgnuradio-osmosdr
-Libs.private: @GR_OSMOSDR_PC_LIBS@
diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt
index 09838c1..3bb52f8 100644
--- a/grc/CMakeLists.txt
+++ b/grc/CMakeLists.txt
@@ -1,45 +1,44 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
########################################################################
-# Rules for generating the source and sink xml wrappers
+# Rules for generating the source and sink yml wrappers
########################################################################
include(GrPython)
-macro(GEN_BLOCK_XML _generator _xml_block)
+macro(GEN_BLOCK_YAML _generator _yaml_block)
set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator})
- set(xml_block ${CMAKE_CURRENT_BINARY_DIR}/${_xml_block})
- list(APPEND xml_blocks ${xml_block})
+ set(yaml_block ${CMAKE_CURRENT_BINARY_DIR}/${_yaml_block})
+ list(APPEND yaml_blocks ${yaml_block})
add_custom_command(
- DEPENDS ${generator} OUTPUT ${xml_block}
- COMMAND ${PYTHON_EXECUTABLE} ${generator} ${xml_block}
+ DEPENDS ${generator} OUTPUT ${yaml_block}
+ COMMAND ${PYTHON_EXECUTABLE} ${generator} ${yaml_block}
)
-endmacro(GEN_BLOCK_XML)
+endmacro(GEN_BLOCK_YAML)
-GEN_BLOCK_XML(gen_osmosdr_blocks.py rtlsdr_source.xml)
-GEN_BLOCK_XML(gen_osmosdr_blocks.py osmosdr_source.xml)
-GEN_BLOCK_XML(gen_osmosdr_blocks.py osmosdr_sink.xml)
+GEN_BLOCK_YAML(gen_osmosdr_blocks.py rtlsdr_source.block.yml)
+GEN_BLOCK_YAML(gen_osmosdr_blocks.py osmosdr_source.block.yml)
+GEN_BLOCK_YAML(gen_osmosdr_blocks.py osmosdr_sink.block.yml)
-add_custom_target(osmosdr_grc_xml_blocks ALL DEPENDS ${xml_blocks})
+add_custom_target(osmosdr_grc_yaml_blocks ALL DEPENDS ${yaml_blocks})
install(FILES
- ${xml_blocks}
-# DESTINATION ${GRC_BLOCKS_DIR}
+ ${yaml_blocks}
DESTINATION share/gnuradio/grc/blocks
)
diff --git a/grc/gen_osmosdr_blocks.py b/grc/gen_osmosdr_blocks.py
index d1f2b1a..3bba1b2 100644
--- a/grc/gen_osmosdr_blocks.py
+++ b/grc/gen_osmosdr_blocks.py
@@ -19,478 +19,388 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
MAIN_TMPL = """\
-<?xml version="1.0"?>
-<block>
- <name>$(title) $sourk.title()</name>
- <key>$(prefix)_$(sourk)</key>
- <category>$($sourk.title())s</category>
- <throttle>1</throttle>
- <import>import osmosdr</import>
- <import>import time</import>
- <make>osmosdr.$(sourk)( args="numchan=" + str(\$nchan) + " " + \$args )
-#for $m in range($max_mboards)
-########################################################################
-\#if \$num_mboards() > $m and \$clock_source$(m)()
-self.\$(id).set_clock_source(\$clock_source$(m), $m)
-\#end if
-########################################################################
-\#if \$num_mboards() > $m and \$time_source$(m)()
-self.\$(id).set_time_source(\$time_source$(m), $m)
-\#end if
-########################################################################
-#end for
-\#if \$sync() == 'sync'
-self.\$(id).set_time_unknown_pps(osmosdr.time_spec_t())
-\#elif \$sync() == 'pc_clock'
-self.\$(id).set_time_now(osmosdr.time_spec_t(time.time()), osmosdr.ALL_MBOARDS)
-\#end if
-self.\$(id).set_sample_rate(\$sample_rate)
-#for $n in range($max_nchan)
-\#if \$nchan() > $n
-self.\$(id).set_center_freq(\$freq$(n), $n)
-self.\$(id).set_freq_corr(\$corr$(n), $n)
-#if $sourk == 'source':
-self.\$(id).set_dc_offset_mode(\$dc_offset_mode$(n), $n)
-self.\$(id).set_iq_balance_mode(\$iq_balance_mode$(n), $n)
-self.\$(id).set_gain_mode(\$gain_mode$(n), $n)
-#end if
-self.\$(id).set_gain(\$gain$(n), $n)
-self.\$(id).set_if_gain(\$if_gain$(n), $n)
-self.\$(id).set_bb_gain(\$bb_gain$(n), $n)
-self.\$(id).set_antenna(\$ant$(n), $n)
-self.\$(id).set_bandwidth(\$bw$(n), $n)
-\#end if
-#end for
- </make>
- <callback>set_sample_rate(\$sample_rate)</callback>
- #for $n in range($max_nchan)
- <callback>set_center_freq(\$freq$(n), $n)</callback>
- <callback>set_freq_corr(\$corr$(n), $n)</callback>
- #if $sourk == 'source':
- <callback>set_dc_offset_mode(\$dc_offset_mode$(n), $n)</callback>
- <callback>set_iq_balance_mode(\$iq_balance_mode$(n), $n)</callback>
- <callback>set_gain_mode(\$gain_mode$(n), $n)</callback>
- #end if
- <callback>set_gain(\$gain$(n), $n)</callback>
- <callback>set_if_gain(\$if_gain$(n), $n)</callback>
- <callback>set_bb_gain(\$bb_gain$(n), $n)</callback>
- <callback>set_antenna(\$ant$(n), $n)</callback>
- <callback>set_bandwidth(\$bw$(n), $n)</callback>
- #end for
- <param>
- <name>$(dir.title())put Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex float32</name>
- <key>fc32</key>
- <opt>type:fc32</opt>
- </option>
- </param>
- <param>
- <name>Device Arguments</name>
- <key>args</key>
- <value></value>
- <type>string</type>
- <hide>
- \#if \$args()
- none
- \#else
- part
- \#end if
- </hide>
- </param>
- <param>
- <name>Sync</name>
- <key>sync</key>
- <value></value>
- <type>enum</type>
- <hide>\#if \$sync() then 'none' else 'part'#</hide>
- <option>
- <name>unknown PPS</name>
- <key>sync</key>
- </option>
- <option>
- <name>PC Clock</name>
- <key>pc_clock</key>
- </option>
- <option>
- <name>don't sync</name>
- <key></key>
- </option>
- </param>
- <param>
- <name>Num Mboards</name>
- <key>num_mboards</key>
- <value>1</value>
- <type>int</type>
- <hide>part</hide>
- #for $m in range(1, $max_mboards+1)
- <option>
- <name>$(m)</name>
- <key>$m</key>
- </option>
- #end for
- </param>
- #for $m in range($max_mboards)
- <param>
- <name>Mb$(m): Clock Source</name>
- <key>clock_source$(m)</key>
- <value></value>
- <type>string</type>
- <hide>
- \#if not \$num_mboards() > $m
- all
- \#elif \$clock_source$(m)()
- none
- \#else
- part
- \#end if
- </hide>
- <option><name>Default</name><key></key></option>
- <option><name>Internal</name><key>internal</key></option>
- <option><name>External</name><key>external</key></option>
- <option><name>External 1PPS</name><key>external_1pps</key></option>
- <option><name>MIMO Cable</name><key>mimo</key></option>
- <option><name>O/B GPSDO</name><key>gpsdo</key></option>
- </param>
- <param>
- <name>Mb$(m): Time Source</name>
- <key>time_source$(m)</key>
- <value></value>
- <type>string</type>
- <hide>
- \#if not \$num_mboards() > $m
- all
- \#elif \$time_source$(m)()
- none
- \#else
- part
- \#end if
- </hide>
- <option><name>Default</name><key></key></option>
- <option><name>External</name><key>external</key></option>
- <option><name>MIMO Cable</name><key>mimo</key></option>
- <option><name>O/B GPSDO</name><key>gpsdo</key></option>
- </param>
- #end for
- <param>
- <name>Num Channels</name>
- <key>nchan</key>
- <value>1</value>
- <type>int</type>
- #for $n in range(1, $max_nchan+1)
- <option>
- <name>$(n)</name>
- <key>$n</key>
- </option>
- #end for
- </param>
- <param>
- <name>Sample Rate (sps)</name>
- <key>sample_rate</key>
- <value>samp_rate</value>
- <type>real</type>
- </param>
- $params
- <check>$max_nchan >= \$nchan</check>
- <check>\$nchan > 0</check>
- <check>$max_mboards >= \$num_mboards</check>
- <check>\$num_mboards > 0</check>
- <check>\$nchan >= \$num_mboards</check>
- <$sourk>
- <name>$dir</name>
- <type>\$type.type</type>
- <nports>\$nchan</nports>
- </$sourk>
- <doc>
-The osmocom $sourk block:
-
-While primarily being developed for the OsmoSDR hardware, this block as well supports:
-
-#if $sourk == 'source':
- * FUNcube Dongle through libgnuradio-fcd
- * FUNcube Dongle Pro+ through gr-fcdproplus
- * sysmocom OsmoSDR Devices through libosmosdr
- * RTL2832U based DVB-T dongles through librtlsdr
- * RTL-TCP spectrum server (see librtlsdr project)
- * MSi2500 based DVB-T dongles through libmirisdr
- * SDRplay RSP devices through SDRplay library
- * gnuradio .cfile input through libgnuradio-blocks
- * RFSPACE SDR-IQ, SDR-IP, NetSDR (incl. X2 option)
- * AirSpy Wideband Receiver through libairspy
-#end if
-#if $sourk == 'sink':
- * gnuradio .cfile output through libgnuradio-blocks
-#end if
- * CCCamp 2015 rad1o Badge through libhackrf
- * Great Scott Gadgets HackRF through libhackrf
- * Nuand LLC bladeRF through libbladeRF library
- * Ettus USRP Devices through Ettus UHD library
- * Fairwaves UmTRX through Fairwaves' fork of UHD
- * Red Pitaya SDR transceiver (http://bazaar.redpitaya.com)
- * FreeSRP through libfreesrp library
-
-By using the osmocom $sourk block you can take advantage of a common software api in your application(s) independent of the underlying radio hardware.
-
-Output Type:
-This parameter controls the data type of the stream in gnuradio. Only complex float32 samples are supported at the moment.
-
-Device Arguments:
-The device argument is a comma delimited string used to locate devices on your system. Device arguments for multiple devices may be given by separating them with a space.
-Use the device id or name/serial (if applicable) to specify a certain device or list of devices. If left blank, the first device found will be used.
-
-Examples:
-
-Optional arguments are placed into [] brackets, remove the brackets before using them! Specific variable values are separated with a |, choose one of them. Variable values containing spaces shall be enclosed in '' as demonstrated in examples section below.
-Lines ending with ... mean it's possible to bind devices together by specifying multiple device arguments separated with a space.
-
-#if $sourk == 'source':
- fcd=0[,device=hw:2][,type=2]
- miri=0[,buffers=32] ...
- rtl=serial_number ...
- rtl=0[,rtl_xtal=28.8e6][,tuner_xtal=28.8e6] ...
- rtl=1[,buffers=32][,buflen=N*512] ...
- rtl=2[,direct_samp=0|1|2][,offset_tune=0|1][,bias=0|1] ...
- rtl_tcp=127.0.0.1:1234[,psize=16384][,direct_samp=0|1|2][,offset_tune=0|1][,bias=0|1] ...
- osmosdr=0[,buffers=32][,buflen=N*512] ...
- file='/path/to/your file',rate=1e6[,freq=100e6][,repeat=true][,throttle=true] ...
- netsdr=127.0.0.1[:50000][,nchan=2]
- sdr-ip=127.0.0.1[:50000]
- cloudiq=127.0.0.1[:50000]
- sdr-iq=/dev/ttyUSB0
- airspy=0[,bias=0|1][,linearity][,sensitivity]
-#end if
-#if $sourk == 'sink':
- file='/path/to/your file',rate=1e6[,freq=100e6][,append=true][,throttle=true] ...
-#end if
- redpitaya=192.168.1.100[:1001]
- freesrp=0[,fx3='path/to/fx3.img',fpga='path/to/fpga.bin',loopback]
- hackrf=0[,buffers=32][,bias=0|1][,bias_tx=0|1]
- bladerf=0[,tamer=internal|external|external_1pps][,smb=25e6]
- uhd[,serial=...][,lo_offset=0][,mcr=52e6][,nchan=2][,subdev='\\\\'B:0 A:0\\\\''] ...
-
-Num Channels:
-Selects the total number of channels in this multi-device configuration. Required when specifying multiple device arguments.
-
-Sample Rate:
-The sample rate is the number of samples per second output by this block on each channel.
-
-Frequency:
-The center frequency is the frequency the RF chain is tuned to.
-
-Freq. Corr.:
-The frequency correction factor in parts per million (ppm). Set to 0 if unknown.
-
-#if $sourk == 'source':
-DC Offset Mode:
-Controls the behavior of hardware DC offset corrrection.
- Off: Disable correction algorithm (pass through).
- Manual: Keep last estimated correction when switched from Automatic to Manual.
- Automatic: Periodicallly find the best solution to compensate for DC offset.
-
-This functionality is available for USRP devices only.
-
-IQ Balance Mode:
-Controls the behavior of software IQ imbalance corrrection.
- Off: Disable correction algorithm (pass through).
- Manual: Keep last estimated correction when switched from Automatic to Manual.
- Automatic: Periodicallly find the best solution to compensate for image signals.
-
-This functionality depends on http://cgit.osmocom.org/cgit/gr-iqbal/
-
-Gain Mode:
-Chooses between the manual (default) and automatic gain mode where appropriate.
-To allow manual control of RF/IF/BB gain stages, manual gain mode must be configured.
-Currently, only RTL-SDR devices support automatic gain mode.
-
-#end if
-RF Gain:
-Overall RF gain of the device.
-
-IF Gain:
-Overall intermediate frequency gain of the device.
-This setting is available for RTL-SDR and OsmoSDR devices with E4000 tuners and HackRF in receive and transmit mode. Observations lead to a reasonable gain range from 15 to 30dB.
-
-BB Gain:
-Overall baseband gain of the device.
-This setting is available for HackRF in receive mode. Observations lead to a reasonable gain range from 15 to 30dB.
-
-Antenna:
-For devices with only one antenna, this may be left blank.
-Otherwise, the user should specify one of the possible antenna choices.
-
-Bandwidth:
-Set the bandpass filter on the radio frontend. To use the default (automatic) bandwidth filter setting, this should be zero.
-
-See the OsmoSDR project page for more detailed documentation:
-http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
-http://sdr.osmocom.org/trac/wiki/rtl-sdr
-http://sdr.osmocom.org/trac/
- </doc>
-</block>
+id: ${prefix}_${sourk}
+label: '${title} ${sourk.title()}'
+category: '[OsmoSDR]'
+flags: throttle
+
+parameters:
+- id: type
+ label: '${direction.title()}put Type'
+ dtype: enum
+ options: [fc32]
+ option_labels: [Complex Float32]
+ option_attributes:
+ type: [fc32]
+ hide: part
+- id: args
+ label: 'Device Arguments'
+ dtype: string
+ default: '""'
+ hide: ${'$'}{ 'none' if args else 'part'}
+- id: sync
+ label: Sync
+ dtype: enum
+ options: [sync, pc_clock, none]
+ option_labels: [Unknown PPS, PC Clock, Don't Sync]
+ hide: ${'$'}{ 'none' if sync else 'part'}
+- id: num_mboards
+ label: 'Number MBoards'
+ dtype: int
+ default: 1
+ options: [ ${", ".join([str(n) for n in range(1, max_mboards+1)])} ]
+ hide: part
+% for m in range(max_mboards):
+- id: clock_source${m}
+ label: 'MB${m}: Clock Source'
+ dtype: string
+ options: ['', internal, external, external_1pps, mimo, gpsdo]
+ option_labels: [Default, Internal, External, External 1PPS, MIMO Cable, O/B GPSDO]
+ hide: ${'$'}{ 'all' if not (num_mboards > ${m}) else ( 'none' if clock_source${m} else 'part' )}
+- id: time_source${m}
+ label: 'MB${m}: Time Source'
+ dtype: string
+ options: ['', external, mimo, gpsdo]
+ option_labels: [Default, External, MIMO Cable, O/B GPSDO]
+ hide: ${'$'}{ 'all' if not (num_mboards > ${m}) else ( 'none' if time_source${m} else 'part' )}
+% endfor
+- id: nchan
+ label: 'Number Channels'
+ dtype: int
+ default: 1
+ options: [ ${", ".join([str(n) for n in range(1, max_nchan+1)])} ]
+- id: sample_rate
+ label: 'Sample Rate (sps)'
+ dtype: real
+ default: samp_rate
+${params}
+
+inputs:
+- domain: message
+ id: command
+ optional: true
+% if sourk == 'source':
+
+outputs:
+% endif
+- domain: stream
+ dtype: ${'$'}{type.type}
+ multiplicity: ${'$'}{nchan}
+% if sourk == 'sink':
+
+outputs:
+- domain: message
+ id: async_msgs
+ optional: true
+% endif
+
+templates:
+ imports: |-
+ import osmosdr
+ import time
+ make: |
+ osmosdr.${sourk}(
+ args="numchan=" + str(${'$'}{nchan}) + " " + ${'$'}{args}
+ )
+ % for m in range(max_mboards):
+ ${'%'} if context.get('num_mboards')() > ${m}:
+ ${'%'} if context.get('clock_source${m}')():
+ self.${'$'}{id}.set_clock_source(${'$'}{${'clock_source' + str(m)}}, ${m})
+ ${'%'} endif
+ ${'%'} if context.get('time_source${m}')():
+ self.${'$'}{id}.set_time_source(${'$'}{${'time_source' + str(m)}}, ${m})
+ ${'%'} endif
+ ${'%'} endif
+ % endfor
+ ${'%'} if sync == 'sync':
+ self.${'$'}{id}.set_time_unknown_pps(osmosdr.time_spec_t())
+ ${'%'} elif sync == 'pc_clock':
+ self.${'$'}{id}.set_time_now(osmosdr.time_spec_t(time.time()), osmosdr.ALL_MBOARDS)
+ ${'%'} endif
+ self.${'$'}{id}.set_sample_rate(${'$'}{sample_rate})
+ % for n in range(max_nchan):
+ ${'%'} if context.get('nchan')() > ${n}:
+ self.${'$'}{id}.set_center_freq(${'$'}{${'freq' + str(n)}}, ${n})
+ self.${'$'}{id}.set_freq_corr(${'$'}{${'corr' + str(n)}}, ${n})
+ % if sourk == 'source':
+ self.${'$'}{id}.set_dc_offset_mode(${'$'}{${'dc_offset_mode' + str(n)}}, ${n})
+ self.${'$'}{id}.set_iq_balance_mode(${'$'}{${'iq_balance_mode' + str(n)}}, ${n})
+ self.${'$'}{id}.set_gain_mode(${'$'}{${'gain_mode' + str(n)}}, ${n})
+ % endif
+ self.${'$'}{id}.set_gain(${'$'}{${'gain' + str(n)}}, ${n})
+ self.${'$'}{id}.set_if_gain(${'$'}{${'if_gain' + str(n)}}, ${n})
+ self.${'$'}{id}.set_bb_gain(${'$'}{${'bb_gain' + str(n)}}, ${n})
+ self.${'$'}{id}.set_antenna(${'$'}{${'ant' + str(n)}}, ${n})
+ self.${'$'}{id}.set_bandwidth(${'$'}{${'bw' + str(n)}}, ${n})
+ ${'%'} endif
+ % endfor
+ callbacks:
+ - set_sample_rate(${'$'}{sample_rate})
+ % for n in range(max_nchan):
+ - set_center_freq(${'$'}{${'freq' + str(n)}}, ${n})
+ - set_freq_corr(${'$'}{${'corr' + str(n)}}, ${n})
+ % if sourk == 'source':
+ - set_dc_offset_mode(${'$'}{${'dc_offset_mode' + str(n)}}, ${n})
+ - set_iq_balance_mode(${'$'}{${'iq_balance_mode' + str(n)}}, ${n})
+ - set_gain_mode(${'$'}{${'gain_mode' + str(n)}}, ${n})
+ % endif
+ - set_gain(${'$'}{${'gain' + str(n)}}, ${n})
+ - set_if_gain(${'$'}{${'if_gain' + str(n)}}, ${n})
+ - set_bb_gain(${'$'}{${'bb_gain' + str(n)}}, ${n})
+ - set_antenna(${'$'}{${'ant' + str(n)}}, ${n})
+ - set_bandwidth(${'$'}{${'bw' + str(n)}}, ${n})
+ % endfor
+
+documentation: |-
+ The osmocom ${sourk} block:
+
+ While primarily being developed for the OsmoSDR hardware, this block as well supports:
+
+ % if sourk == 'source':
+ * RTL2832U based DVB-T dongles through librtlsdr
+ * RTL-TCP spectrum server (see librtlsdr project)
+ * MSi2500 based DVB-T dongles through libmirisdr
+ * SDRplay RSP devices through SDRplay library
+ * gnuradio .cfile input through libgnuradio-blocks
+ * RFSPACE SDR-IQ, SDR-IP, NetSDR (incl. X2 option)
+ * AirSpy Wideband Receiver through libairspy
+ % endif
+ % if sourk == 'sink':
+ * gnuradio .cfile output through libgnuradio-blocks
+ % endif
+ * CCCamp 2015 rad1o Badge through libhackrf
+ * Great Scott Gadgets HackRF through libhackrf
+ * Nuand LLC bladeRF through libbladeRF library
+ * Ettus USRP Devices through Ettus UHD library
+ * Fairwaves XTRX through libxtrx
+ * Fairwaves UmTRX through Fairwaves' module for UHD
+ * Red Pitaya SDR transceiver (http://bazaar.redpitaya.com)
+ * FreeSRP through libfreesrp library
+
+ By using the osmocom $sourk block you can take advantage of a common software api in your application(s) independent of the underlying radio hardware.
+
+ Output Type:
+ This parameter controls the data type of the stream in gnuradio. Only complex float32 samples are supported at the moment.
+
+ Device Arguments:
+ The device argument is a comma delimited string used to locate devices on your system. Device arguments for multiple devices may be given by separating them with a space.
+ Use the device id or name/serial (if applicable) to specify a certain device or list of devices. If left blank, the first device found will be used.
+
+ Examples:
+
+ Optional arguments are placed into [] brackets, remove the brackets before using them! Specific variable values are separated with a |, choose one of them. Variable values containing spaces shall be enclosed in '' as demonstrated in examples section below.
+ Lines ending with ... mean it's possible to bind devices together by specifying multiple device arguments separated with a space.
+
+ % if sourk == 'source':
+ miri=0[,buffers=32] ...
+ rtl=serial_number ...
+ rtl=0[,rtl_xtal=28.8e6][,tuner_xtal=28.8e6] ...
+ rtl=1[,buffers=32][,buflen=N*512] ...
+ rtl=2[,direct_samp=0|1|2][,offset_tune=0|1][,bias=0|1] ...
+ rtl_tcp=127.0.0.1:1234[,psize=16384][,direct_samp=0|1|2][,offset_tune=0|1][,bias=0|1] ...
+ file='/path/to/your file',rate=1e6[,freq=100e6][,repeat=true][,throttle=true] ...
+ netsdr=127.0.0.1[:50000][,nchan=2]
+ sdr-ip=127.0.0.1[:50000]
+ cloudiq=127.0.0.1[:50000]
+ sdr-iq=/dev/ttyUSB0
+ airspy=0[,bias=0|1][,linearity][,sensitivity]
+ % endif
+ % if sourk == 'sink':
+ file='/path/to/your file',rate=1e6[,freq=100e6][,append=true][,throttle=true] ...
+ % endif
+ redpitaya=192.168.1.100[:1001]
+ freesrp=0[,fx3='path/to/fx3.img',fpga='path/to/fpga.bin',loopback]
+ hackrf=0[,buffers=32][,bias=0|1][,bias_tx=0|1]
+ bladerf=0[,tamer=internal|external|external_1pps][,smb=25e6]
+ uhd[,serial=...][,lo_offset=0][,mcr=52e6][,nchan=2][,subdev='\\\\'B:0 A:0\\\\''] ...
+ xtrx
+
+ Num Channels:
+ Selects the total number of channels in this multi-device configuration. Required when specifying multiple device arguments.
+
+ Sample Rate:
+ The sample rate is the number of samples per second output by this block on each channel.
+
+ Frequency:
+ The center frequency is the frequency the RF chain is tuned to.
+
+ Freq. Corr.:
+ The frequency correction factor in parts per million (ppm). Set to 0 if unknown.
+
+ % if sourk == 'source':
+ DC Offset Mode:
+ Controls the behavior of hardware DC offset corrrection.
+ Off: Disable correction algorithm (pass through).
+ Manual: Keep last estimated correction when switched from Automatic to Manual.
+ Automatic: Periodicallly find the best solution to compensate for DC offset.
+
+ This functionality is available for USRP devices only.
+
+ IQ Balance Mode:
+ Controls the behavior of software IQ imbalance corrrection.
+ Off: Disable correction algorithm (pass through).
+ Manual: Keep last estimated correction when switched from Automatic to Manual.
+ Automatic: Periodicallly find the best solution to compensate for image signals.
+
+ This functionality depends on http://cgit.osmocom.org/cgit/gr-iqbal/
+
+ Gain Mode:
+ Chooses between the manual (default) and automatic gain mode where appropriate.
+ To allow manual control of RF/IF/BB gain stages, manual gain mode must be configured.
+ Currently, only RTL-SDR devices support automatic gain mode.
+
+ % endif
+ RF Gain:
+ Overall RF gain of the device.
+
+ IF Gain:
+ Overall intermediate frequency gain of the device.
+ This setting is available for RTL-SDR and OsmoSDR devices with E4000 tuners and HackRF in receive and transmit mode. Observations lead to a reasonable gain range from 15 to 30dB.
+
+ BB Gain:
+ Overall baseband gain of the device.
+ This setting is available for HackRF in receive mode. Observations lead to a reasonable gain range from 15 to 30dB.
+
+ Antenna:
+ For devices with only one antenna, this may be left blank.
+ Otherwise, the user should specify one of the possible antenna choices.
+
+ Bandwidth:
+ Set the bandpass filter on the radio frontend. To use the default (automatic) bandwidth filter setting, this should be zero.
+
+ See the OsmoSDR project page for more detailed documentation:
+ http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
+ http://sdr.osmocom.org/trac/wiki/rtl-sdr
+ http://sdr.osmocom.org/trac/
+
+file_format: 1
"""
+# MAIN_TMPL = """\
+# <block>
+# <check>$max_nchan >= \$nchan</check>
+# <check>\$nchan > 0</check>
+# <check>$max_mboards >= \$num_mboards</check>
+# <check>\$num_mboards > 0</check>
+# <check>\$nchan >= \$num_mboards</check>
+# </block>
+# """
+
PARAMS_TMPL = """
- <param>
- <name>Ch$(n): Frequency (Hz)</name>
- <key>freq$(n)</key>
- <value>100e6</value>
- <type>real</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- </param>
- <param>
- <name>Ch$(n): Freq. Corr. (ppm)</name>
- <key>corr$(n)</key>
- <value>0</value>
- <type>real</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- </param>
-#if $sourk == 'source':
- <param>
- <name>Ch$(n): DC Offset Mode</name>
- <key>dc_offset_mode$(n)</key>
- <value>0</value>
- <type>int</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- <option>
- <name>Off</name>
- <key>0</key>
- </option>
- <option>
- <name>Manual</name>
- <key>1</key>
- </option>
- <option>
- <name>Automatic</name>
- <key>2</key>
- </option>
- </param>
- <param>
- <name>Ch$(n): IQ Balance Mode</name>
- <key>iq_balance_mode$(n)</key>
- <value>0</value>
- <type>int</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- <option>
- <name>Off</name>
- <key>0</key>
- </option>
- <option>
- <name>Manual</name>
- <key>1</key>
- </option>
- <option>
- <name>Automatic</name>
- <key>2</key>
- </option>
- </param>
- <param>
- <name>Ch$(n): Gain Mode</name>
- <key>gain_mode$(n)</key>
- <value>False</value>
- <type>bool</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- <option>
- <name>Manual</name>
- <key>False</key>
- </option>
- <option>
- <name>Automatic</name>
- <key>True</key>
- </option>
- </param>
-#end if
- <param>
- <name>Ch$(n): RF Gain (dB)</name>
- <key>gain$(n)</key>
- <value>10</value>
- <type>real</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- </param>
- <param>
- <name>Ch$(n): IF Gain (dB)</name>
- <key>if_gain$(n)</key>
- <value>20</value>
- <type>real</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- </param>
- <param>
- <name>Ch$(n): BB Gain (dB)</name>
- <key>bb_gain$(n)</key>
- <value>20</value>
- <type>real</type>
- <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
- </param>
- <param>
- <name>Ch$(n): Antenna</name>
- <key>ant$(n)</key>
- <value></value>
- <type>string</type>
- <hide>
- \#if not \$nchan() > $n
- all
- \#elif \$ant$(n)()
- none
- \#else
- part
- \#end if
- </hide>
- </param>
- <param>
- <name>Ch$(n): Bandwidth (Hz)</name>
- <key>bw$(n)</key>
- <value>0</value>
- <type>real</type>
- <hide>
- \#if not \$nchan() > $n
- all
- \#elif \$bw$(n)()
- none
- \#else
- part
- \#end if
- </hide>
- </param>
+- id: freq${n}
+ label: 'Ch${n}: Frequency (Hz)'
+ dtype: real
+ default: 100e6
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+- id: corr${n}
+ label: 'Ch${n}: Frequency Correction (ppm)'
+ dtype: real
+ default: 0
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+% if sourk == 'source':
+- id: dc_offset_mode${n}
+ label: 'Ch${n}: DC Offset Mode'
+ dtype: int
+ default: 0
+ options: [0, 1, 2]
+ option_labels: [Off, Manual, Automatic]
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+- id: iq_balance_mode${n}
+ label: 'Ch${n}: IQ Balance Mode'
+ dtype: int
+ default: 0
+ options: [0, 1, 2]
+ option_labels: [Off, Manual, Automatic]
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+- id: gain_mode${n}
+ label: 'Ch${n}: Gain Mode'
+ dtype: bool
+ default: False
+ options: [False, True]
+ option_labels: [Manual, Automatic]
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+% endif
+- id: gain${n}
+ label: 'Ch${n}: RF Gain (dB)'
+ dtype: real
+ default: 10
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+- id: if_gain${n}
+ label: 'Ch${n}: IF Gain (dB)'
+ dtype: real
+ default: 20
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+- id: bb_gain${n}
+ label: 'Ch${n}: BB Gain (dB)'
+ dtype: real
+ default: 20
+ hide: ${'$'}{'none' if (nchan > ${n}) else 'all'}
+- id: ant${n}
+ label: 'Ch${n}: Antenna'
+ dtype: string
+ default: ""
+ hide: ${'$'}{'all' if not (nchan > ${n}) else ('none' if eval('ant' + str(${n})) else 'part')}
+- id: bw${n}
+ label: 'Ch${n}: Bandwidth (Hz)'
+ dtype: real
+ default: 0
+ hide: ${'$'}{'all' if not (nchan > ${n}) else ('none' if eval('bw' + str(${n})) else 'part')}
"""
+
def parse_tmpl(_tmpl, **kwargs):
- from Cheetah import Template
- return str(Template.Template(_tmpl, kwargs))
+ from mako.template import Template
+ from mako import exceptions
+
+ try:
+ block_template = Template(_tmpl)
+ return str(block_template.render(**kwargs))
+ except:
+ print(exceptions.text_error_template().render())
-max_num_mboards = 8
-max_num_channels = max_num_mboards*4
+MAX_NUM_MBOARDS = 8
+MAX_NUM_CHANNELS = MAX_NUM_MBOARDS * 4
import os.path
if __name__ == '__main__':
- import sys
- for file in sys.argv[1:]:
- head, tail = os.path.split(file)
-
- if tail.startswith('rtlsdr'):
- title = 'RTL-SDR'
- prefix = 'rtlsdr'
- elif tail.startswith('osmosdr'):
- title = 'osmocom'
- prefix = 'osmosdr'
- else: raise Exception, 'file %s has wrong syntax!'%tail
-
- if tail.endswith ('source.xml'):
- sourk = 'source'
- dir = 'out'
- elif tail.endswith ('sink.xml'):
- sourk = 'sink'
- dir = 'in'
- else: raise Exception, 'is %s a source or sink?'%file
-
- params = ''.join([parse_tmpl(PARAMS_TMPL, n=n, sourk=sourk) for n in range(max_num_channels)])
- open(file, 'w').write(parse_tmpl(MAIN_TMPL,
- max_nchan=max_num_channels,
- max_mboards=max_num_mboards,
- params=params,
- title=title,
- prefix=prefix,
- sourk=sourk,
- dir=dir,
- ))
+ import sys
+
+ for file in sys.argv[1:]:
+ head, tail = os.path.split(file)
+
+ if tail.startswith('rtlsdr'):
+ title = 'RTL-SDR'
+ prefix = 'rtlsdr'
+ elif tail.startswith('osmosdr'):
+ title = 'osmocom'
+ prefix = 'osmosdr'
+ else:
+ raise Exception("file {} has wrong syntax!".format(tail))
+
+ if tail.endswith('source.block.yml'):
+ sourk = 'source'
+ direction = 'out'
+ elif tail.endswith('sink.block.yml'):
+ sourk = 'sink'
+ direction = 'in'
+ else:
+ raise Exception("is {} a source or sink?".format(file))
+
+ params = ''.join([
+ parse_tmpl(PARAMS_TMPL, n=n, sourk=sourk)
+ for n in range(MAX_NUM_CHANNELS)
+ ])
+
+ open(file, 'w').write(
+ parse_tmpl(
+ MAIN_TMPL,
+ max_nchan=MAX_NUM_CHANNELS,
+ max_mboards=MAX_NUM_MBOARDS,
+ params=params,
+ title=title,
+ prefix=prefix,
+ sourk=sourk,
+ direction=direction,
+ )
+ )
diff --git a/include/osmosdr/CMakeLists.txt b/include/osmosdr/CMakeLists.txt
index d185ee6..9d284d6 100644
--- a/include/osmosdr/CMakeLists.txt
+++ b/include/osmosdr/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
diff --git a/include/osmosdr/pimpl.h b/include/osmosdr/pimpl.h
index e1985b4..3a99994 100644
--- a/include/osmosdr/pimpl.h
+++ b/include/osmosdr/pimpl.h
@@ -18,7 +18,7 @@
#ifndef INCLUDED_OSMOSDR_PIMPL_H
#define INCLUDED_OSMOSDR_PIMPL_H
-#include <boost/shared_ptr.hpp>
+#include <memory>
/*! \file pimpl.h
* "Pimpl idiom" (pointer to implementation idiom).
@@ -39,7 +39,7 @@
* \param _name the name of the pimpl class
*/
#define OSMOSDR_PIMPL_DECL(_name) \
- struct _name; boost::shared_ptr<_name>
+ struct _name; std::shared_ptr<_name>
/*!
* Make an instance of a pimpl in a source file.
@@ -49,6 +49,6 @@
* \param _args the constructor args for the pimpl
*/
#define OSMOSDR_PIMPL_MAKE(_name, _args) \
- boost::shared_ptr<_name>(new _name _args)
+ std::shared_ptr<_name>(new _name _args)
#endif /* INCLUDED_OSMOSDR_PIMPL_H */
diff --git a/include/osmosdr/sink.h b/include/osmosdr/sink.h
index 906976e..1f72a5e 100644
--- a/include/osmosdr/sink.h
+++ b/include/osmosdr/sink.h
@@ -38,7 +38,7 @@ class sink;
class OSMOSDR_API sink : virtual public gr::hier_block2
{
public:
- typedef boost::shared_ptr< sink > sptr;
+ typedef std::shared_ptr< sink > sptr;
/*!
* \brief Return a shared_ptr to a new instance of sink.
diff --git a/include/osmosdr/source.h b/include/osmosdr/source.h
index 88f8385..20c77b1 100644
--- a/include/osmosdr/source.h
+++ b/include/osmosdr/source.h
@@ -38,7 +38,7 @@ class source;
class OSMOSDR_API source : virtual public gr::hier_block2
{
public:
- typedef boost::shared_ptr< source > sptr;
+ typedef std::shared_ptr< source > sptr;
/*!
* \brief Return a shared_ptr to a new instance of source.
@@ -63,6 +63,7 @@ public:
*
* \param seek_point sample offset in file
* \param whence one of SEEK_SET, SEEK_CUR, SEEK_END (man fseek)
+ * \param chan the channel index 0 to N-1
* \return true on success
*/
virtual bool seek( long seek_point, int whence, size_t chan = 0 ) = 0;
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index dbb175a..f2b453a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,41 +1,32 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
########################################################################
# Setup library
########################################################################
-INCLUDE(GrPlatform) #define LIB_SUFFIX
-INCLUDE(GrMiscUtils)
-INCLUDE(GrComponent)
+include(GrPlatform) #define LIB_SUFFIX
########################################################################
-# Helpful Macros
+# Setup target
########################################################################
-MACRO(GR_OSMOSDR_APPEND_SRCS)
- LIST(APPEND gr_osmosdr_srcs ${ARGV})
-ENDMACRO(GR_OSMOSDR_APPEND_SRCS)
-MACRO(GR_OSMOSDR_APPEND_LIBS)
- LIST(APPEND gr_osmosdr_libs ${ARGV})
-ENDMACRO(GR_OSMOSDR_APPEND_LIBS)
-
-GR_OSMOSDR_APPEND_SRCS(
+list(APPEND gr_osmosdr_srcs
source_impl.cc
sink_impl.cc
ranges.cc
@@ -49,19 +40,38 @@ if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND Boost_LIBRARIES -pthread)
endif()
-GR_OSMOSDR_APPEND_LIBS(
- ${Boost_LIBRARIES}
- ${GNURADIO_ALL_LIBRARIES}
-)
+#dirty macro to allow appending from subdirs
+#this appends all unnamed implicit macro args!
+MACRO (APPEND_LIB_LIST)
+ SET (gr_osmosdr_libs "${gr_osmosdr_libs};${ARGN}" CACHE INTERNAL "lib list")
+ENDMACRO (APPEND_LIB_LIST)
+
+set(gr_osmosdr_libs "" CACHE INTERNAL "lib that accumulates link targets")
+
+add_library(gnuradio-osmosdr SHARED)
+APPEND_LIB_LIST(${Boost_LIBRARIES} gnuradio::gnuradio-runtime)
+target_include_directories(gnuradio-osmosdr
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC ${Boost_INCLUDE_DIRS}
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
+ PUBLIC $<INSTALL_INTERFACE:include>
+ )
+set_target_properties(gnuradio-osmosdr PROPERTIES DEFINE_SYMBOL "gnuradio_osmosdr_EXPORTS")
+
+if(APPLE)
+ set_target_properties(gnuradio-osmosdr PROPERTIES
+ INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
+ )
+endif(APPLE)
########################################################################
# Setup defines for high resolution timing
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring high resolution timing...")
-INCLUDE(CheckCXXSourceCompiles)
+message(STATUS "")
+message(STATUS "Configuring high resolution timing...")
+include(CheckCXXSourceCompiles)
-SET(CMAKE_REQUIRED_LIBRARIES -lrt)
+set(CMAKE_REQUIRED_LIBRARIES -lrt)
CHECK_CXX_SOURCE_COMPILES("
#include <ctime>
int main(){
@@ -70,9 +80,9 @@ CHECK_CXX_SOURCE_COMPILES("
}
" HAVE_CLOCK_GETTIME
)
-UNSET(CMAKE_REQUIRED_LIBRARIES)
+unset(CMAKE_REQUIRED_LIBRARIES)
-INCLUDE(CheckCXXSourceCompiles)
+include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
#include <mach/mach_time.h>
int main(){
@@ -95,22 +105,22 @@ CHECK_CXX_SOURCE_COMPILES("
" HAVE_QUERY_PERFORMANCE_COUNTER
)
-IF(HAVE_CLOCK_GETTIME)
- MESSAGE(STATUS " High resolution timing supported through clock_gettime.")
- SET(TIME_SPEC_DEFS HAVE_CLOCK_GETTIME)
- GR_OSMOSDR_APPEND_LIBS("-lrt")
-ELSEIF(HAVE_MACH_ABSOLUTE_TIME)
- MESSAGE(STATUS " High resolution timing supported through mach_absolute_time.")
- SET(TIME_SPEC_DEFS HAVE_MACH_ABSOLUTE_TIME)
-ELSEIF(HAVE_QUERY_PERFORMANCE_COUNTER)
- MESSAGE(STATUS " High resolution timing supported through QueryPerformanceCounter.")
- SET(TIME_SPEC_DEFS HAVE_QUERY_PERFORMANCE_COUNTER)
-ELSE()
- MESSAGE(STATUS " High resolution timing supported through microsec_clock.")
- SET(TIME_SPEC_DEFS HAVE_MICROSEC_CLOCK)
-ENDIF()
-
-SET_SOURCE_FILES_PROPERTIES(
+if(HAVE_CLOCK_GETTIME)
+ message(STATUS " High resolution timing supported through clock_gettime.")
+ set(TIME_SPEC_DEFS HAVE_CLOCK_GETTIME)
+ APPEND_LIB_LIST( "-lrt")
+elseif(HAVE_MACH_ABSOLUTE_TIME)
+ message(STATUS " High resolution timing supported through mach_absolute_time.")
+ set(TIME_SPEC_DEFS HAVE_MACH_ABSOLUTE_TIME)
+elseif(HAVE_QUERY_PERFORMANCE_COUNTER)
+ message(STATUS " High resolution timing supported through QueryPerformanceCounter.")
+ set(TIME_SPEC_DEFS HAVE_QUERY_PERFORMANCE_COUNTER)
+else()
+ message(STATUS " High resolution timing supported through microsec_clock.")
+ set(TIME_SPEC_DEFS HAVE_MICROSEC_CLOCK)
+endif()
+
+set_source_files_properties(
time_spec.cc
PROPERTIES COMPILE_DEFINITIONS "${TIME_SPEC_DEFS}"
)
@@ -118,42 +128,27 @@ SET_SOURCE_FILES_PROPERTIES(
########################################################################
# Setup IQBalance component
########################################################################
-GR_REGISTER_COMPONENT("Osmocom IQ Imbalance Correction" ENABLE_IQBALANCE GNURADIO_IQBALANCE_FOUND)
+GR_REGISTER_COMPONENT("Osmocom IQ Imbalance Correction" ENABLE_IQBALANCE gnuradio-iqbalance_FOUND)
if(ENABLE_IQBALANCE)
-add_definitions(-DHAVE_IQBALANCE=1)
-include_directories(${GNURADIO_IQBALANCE_INCLUDE_DIRS})
-GR_OSMOSDR_APPEND_LIBS(${GNURADIO_IQBALANCE_LIBRARIES})
+ add_definitions(-DHAVE_IQBALANCE=1)
+ target_include_directories(gnuradio-osmosdr PRIVATE ${gnuradio-iqbalance_INCLUDE_DIRS})
+ APPEND_LIB_LIST( gnuradio::gnuradio-iqbalance)
endif(ENABLE_IQBALANCE)
########################################################################
-# Setup OsmoSDR component
-########################################################################
-GR_REGISTER_COMPONENT("sysmocom OsmoSDR" ENABLE_OSMOSDR LIBOSMOSDR_FOUND)
-if(ENABLE_OSMOSDR)
-GR_INCLUDE_SUBDIRECTORY(osmosdr)
-endif(ENABLE_OSMOSDR)
-
-########################################################################
# Setup FCD component
########################################################################
-GR_REGISTER_COMPONENT("FUNcube Dongle" ENABLE_FCD GNURADIO_FCD_FOUND)
-GR_REGISTER_COMPONENT("FUNcube Dongle Pro+" ENABLE_FCDPP GNURADIO_FCDPP_FOUND)
+GR_REGISTER_COMPONENT("FUNcube Dongle" ENABLE_FCD GNURADIO_FUNCUBE_FOUND)
if(ENABLE_FCD)
-add_definitions(-DHAVE_FCD=1)
+ add_subdirectory(fcd)
endif(ENABLE_FCD)
-if(ENABLE_FCDPP)
-add_definitions(-DHAVE_FCDPP=1)
-endif(ENABLE_FCDPP)
-if(ENABLE_FCD OR ENABLE_FCDPP)
-GR_INCLUDE_SUBDIRECTORY(fcd)
-endif(ENABLE_FCD OR ENABLE_FCDPP)
########################################################################
# Setup File component
########################################################################
-GR_REGISTER_COMPONENT("IQ File Source & Sink" ENABLE_FILE GNURADIO_BLOCKS_FOUND)
+GR_REGISTER_COMPONENT("IQ File Source & Sink" ENABLE_FILE gnuradio-blocks_FOUND)
if(ENABLE_FILE)
-GR_INCLUDE_SUBDIRECTORY(file)
+ add_subdirectory(file)
endif(ENABLE_FILE)
########################################################################
@@ -161,23 +156,23 @@ endif(ENABLE_FILE)
########################################################################
GR_REGISTER_COMPONENT("Osmocom RTLSDR" ENABLE_RTL LIBRTLSDR_FOUND)
if(ENABLE_RTL)
-GR_INCLUDE_SUBDIRECTORY(rtl)
+ add_subdirectory(rtl)
endif(ENABLE_RTL)
########################################################################
# Setup RTL_TCP component
########################################################################
-GR_REGISTER_COMPONENT("RTLSDR TCP Client" ENABLE_RTL_TCP GNURADIO_BLOCKS_FOUND)
+GR_REGISTER_COMPONENT("RTLSDR TCP Client" ENABLE_RTL_TCP gnuradio-blocks_FOUND)
if(ENABLE_RTL_TCP)
-GR_INCLUDE_SUBDIRECTORY(rtl_tcp)
+ add_subdirectory(rtl_tcp)
endif(ENABLE_RTL_TCP)
########################################################################
# Setup UHD component
########################################################################
-GR_REGISTER_COMPONENT("Ettus USRP Devices" ENABLE_UHD UHD_FOUND GNURADIO_UHD_FOUND)
+GR_REGISTER_COMPONENT("Ettus USRP Devices" ENABLE_UHD UHD_FOUND gnuradio-uhd_FOUND)
if(ENABLE_UHD)
-GR_INCLUDE_SUBDIRECTORY(uhd)
+ add_subdirectory(uhd)
endif(ENABLE_UHD)
########################################################################
@@ -185,7 +180,7 @@ endif(ENABLE_UHD)
########################################################################
GR_REGISTER_COMPONENT("Osmocom MiriSDR" ENABLE_MIRI LIBMIRISDR_FOUND)
if(ENABLE_MIRI)
-GR_INCLUDE_SUBDIRECTORY(miri)
+ add_subdirectory(miri)
endif(ENABLE_MIRI)
########################################################################
@@ -194,7 +189,7 @@ endif(ENABLE_MIRI)
if(ENABLE_NONFREE)
GR_REGISTER_COMPONENT("SDRplay RSP (NONFREE)" ENABLE_SDRPLAY LIBSDRPLAY_FOUND)
if(ENABLE_SDRPLAY)
-GR_INCLUDE_SUBDIRECTORY(sdrplay)
+ add_subdirectory(sdrplay)
endif(ENABLE_SDRPLAY)
endif(ENABLE_NONFREE)
@@ -203,7 +198,7 @@ endif(ENABLE_NONFREE)
########################################################################
GR_REGISTER_COMPONENT("HackRF & rad1o Badge" ENABLE_HACKRF LIBHACKRF_FOUND)
if(ENABLE_HACKRF)
-GR_INCLUDE_SUBDIRECTORY(hackrf)
+ add_subdirectory(hackrf)
endif(ENABLE_HACKRF)
########################################################################
@@ -211,7 +206,7 @@ endif(ENABLE_HACKRF)
########################################################################
GR_REGISTER_COMPONENT("nuand bladeRF" ENABLE_BLADERF LIBBLADERF_FOUND)
if(ENABLE_BLADERF)
-GR_INCLUDE_SUBDIRECTORY(bladerf)
+ add_subdirectory(bladerf)
endif(ENABLE_BLADERF)
########################################################################
@@ -219,7 +214,7 @@ endif(ENABLE_BLADERF)
########################################################################
GR_REGISTER_COMPONENT("RFSPACE Receivers" ENABLE_RFSPACE)
if(ENABLE_RFSPACE)
-GR_INCLUDE_SUBDIRECTORY(rfspace)
+ add_subdirectory(rfspace)
endif(ENABLE_RFSPACE)
########################################################################
@@ -227,15 +222,23 @@ endif(ENABLE_RFSPACE)
########################################################################
GR_REGISTER_COMPONENT("AIRSPY Receiver" ENABLE_AIRSPY LIBAIRSPY_FOUND)
if(ENABLE_AIRSPY)
-GR_INCLUDE_SUBDIRECTORY(airspy)
+ add_subdirectory(airspy)
endif(ENABLE_AIRSPY)
########################################################################
+# Setup AIRSPYHF component
+########################################################################
+GR_REGISTER_COMPONENT("AIRSPY HF+ Receiver" ENABLE_AIRSPYHF LIBAIRSPYHF_FOUND)
+if(ENABLE_AIRSPYHF)
+ add_subdirectory(airspyhf)
+endif(ENABLE_AIRSPYHF)
+
+########################################################################
# Setup SoapySDR component
########################################################################
GR_REGISTER_COMPONENT("SoapySDR support" ENABLE_SOAPY SoapySDR_FOUND)
if(ENABLE_SOAPY)
-GR_INCLUDE_SUBDIRECTORY(soapy)
+ add_subdirectory(soapy)
endif(ENABLE_SOAPY)
########################################################################
@@ -243,7 +246,7 @@ endif(ENABLE_SOAPY)
########################################################################
GR_REGISTER_COMPONENT("Red Pitaya SDR" ENABLE_REDPITAYA)
if(ENABLE_REDPITAYA)
-GR_INCLUDE_SUBDIRECTORY(redpitaya)
+ add_subdirectory(redpitaya)
endif(ENABLE_REDPITAYA)
########################################################################
@@ -251,37 +254,35 @@ endif(ENABLE_REDPITAYA)
########################################################################
GR_REGISTER_COMPONENT("FreeSRP support" ENABLE_FREESRP LIBFREESRP_FOUND)
if(ENABLE_FREESRP)
-GR_INCLUDE_SUBDIRECTORY(freesrp)
+ add_subdirectory(freesrp)
endif(ENABLE_FREESRP)
########################################################################
+# Setup XTRX component
+########################################################################
+GR_REGISTER_COMPONENT("XTRX SDR" ENABLE_XTRX LIBXTRX_FOUND)
+if(ENABLE_XTRX)
+ add_subdirectory(xtrx)
+endif(ENABLE_XTRX)
+
+########################################################################
# Setup configuration file
########################################################################
-ADD_DEFINITIONS(-DHAVE_CONFIG_H=1)
+add_definitions(-DHAVE_CONFIG_H=1)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h
@ONLY)
########################################################################
-# Set up Windows DLL resource files
+# Finalize target
########################################################################
-IF(MSVC)
- include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake)
-
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-osmosdr.rc.in
- ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-osmosdr.rc
- @ONLY)
-
- GR_OSMOSDR_APPEND_SRCS(${CMAKE_CURRENT_BINARY_DIR}/gnuradio-osmosdr.rc)
-ENDIF(MSVC)
+set_target_properties(gnuradio-osmosdr PROPERTIES SOURCES "${gr_osmosdr_srcs}")
+target_link_libraries(gnuradio-osmosdr ${gr_osmosdr_libs})
########################################################################
-# Setup libgnuradio-osmosdr library
+# Install built library files
########################################################################
-ADD_LIBRARY(gnuradio-osmosdr SHARED ${gr_osmosdr_srcs})
-TARGET_LINK_LIBRARIES(gnuradio-osmosdr ${gr_osmosdr_libs})
-SET_TARGET_PROPERTIES(gnuradio-osmosdr PROPERTIES DEFINE_SYMBOL "gnuradio_osmosdr_EXPORTS")
+include(GrMiscUtils)
GR_LIBRARY_FOO(gnuradio-osmosdr)
diff --git a/lib/airspy/CMakeLists.txt b/lib/airspy/CMakeLists.txt
index 3e34aa6..187d938 100644
--- a/lib/airspy/CMakeLists.txt
+++ b/lib/airspy/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,17 +21,18 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${LIBAIRSPY_INCLUDE_DIRS}
)
-set(airspy_srcs
- ${CMAKE_CURRENT_SOURCE_DIR}/airspy_source_c.cc
+APPEND_LIB_LIST(
+ gnuradio::gnuradio-filter
+ ${Gnuradio-blocks_LIBRARIES}
+ ${LIBAIRSPY_LIBRARIES}
)
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${airspy_srcs})
-list(APPEND gr_osmosdr_libs ${LIBAIRSPY_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES})
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/airspy_source_c.cc
+)
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/airspy/airspy_source_c.cc b/lib/airspy/airspy_source_c.cc
index 50150e5..7fd3be8 100644
--- a/lib/airspy/airspy_source_c.cc
+++ b/lib/airspy/airspy_source_c.cc
@@ -33,7 +33,6 @@
#include <boost/assign.hpp>
#include <boost/format.hpp>
-#include <boost/detail/endian.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/thread/thread.hpp>
@@ -291,7 +290,7 @@ int airspy_source_c::work( int noutput_items,
if ( ! running )
return WORK_DONE;
- boost::unique_lock<boost::mutex> lock(_fifo_lock);
+ std::unique_lock<std::mutex> lock(_fifo_lock);
/* Wait until we have the requested number of samples */
int n_samples_avail = _fifo->size();
diff --git a/lib/airspy/airspy_source_c.h b/lib/airspy/airspy_source_c.h
index f8617e6..81add15 100644
--- a/lib/airspy/airspy_source_c.h
+++ b/lib/airspy/airspy_source_c.h
@@ -23,8 +23,9 @@
#define INCLUDED_AIRSPY_SOURCE_C_H
#include <boost/circular_buffer.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+
+#include <mutex>
+#include <condition_variable>
#include <gnuradio/sync_block.h>
@@ -35,7 +36,7 @@
class airspy_source_c;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr::blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -43,9 +44,9 @@ class airspy_source_c;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<airspy_source_c> airspy_source_c_sptr;
+typedef std::shared_ptr<airspy_source_c> airspy_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of airspy_source_c.
@@ -128,8 +129,8 @@ private:
airspy_device *_dev;
boost::circular_buffer<gr_complex> *_fifo;
- boost::mutex _fifo_lock;
- boost::condition_variable _samp_avail;
+ std::mutex _fifo_lock;
+ std::condition_variable _samp_avail;
std::vector< std::pair<double, uint32_t> > _sample_rates;
double _sample_rate;
diff --git a/lib/airspyhf/CMakeLists.txt b/lib/airspyhf/CMakeLists.txt
new file mode 100644
index 0000000..fc13ce2
--- /dev/null
+++ b/lib/airspyhf/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Copyright 2017 Free Software Foundation, Inc.
+#
+# This file is part of gr-osmosdr
+#
+# gr-osmosdr 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, or (at your option)
+# any later version.
+#
+# gr-osmosdr 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 gr-osmosdr; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# This file included, use CMake directory variables
+########################################################################
+
+target_include_directories(gnuradio-osmosdr PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBAIRSPYHF_INCLUDE_DIRS}
+)
+
+APPEND_LIB_LIST(
+ ${Gnuradio-blocks_LIBRARIES}
+ ${LIBAIRSPYHF_LIBRARIES}
+)
+
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/airspyhf_source_c.cc
+)
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/airspyhf/airspyhf_source_c.cc b/lib/airspyhf/airspyhf_source_c.cc
new file mode 100644
index 0000000..26e0134
--- /dev/null
+++ b/lib/airspyhf/airspyhf_source_c.cc
@@ -0,0 +1,437 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2013 Dimitri Stolnikov <horiz0n@gmx.net>
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/*
+ * config.h is generated by configure. It contains the results
+ * of probing for features, options etc. It should be the first
+ * file included in your .cc file.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdexcept>
+#include <iostream>
+#include <algorithm>
+
+#include <boost/assign.hpp>
+#include <boost/format.hpp>
+#include <boost/algorithm/string.hpp>
+#include <boost/thread/thread.hpp>
+
+#include <gnuradio/io_signature.h>
+
+#include "airspyhf_source_c.h"
+#include "arg_helpers.h"
+
+using namespace boost::assign;
+
+#define AIRSPYHF_FORMAT_ERROR(ret, msg) \
+ boost::str( boost::format(msg " (%1%)") % ret )
+
+#define AIRSPYHF_THROW_ON_ERROR(ret, msg) \
+ if ( ret != AIRSPYHF_SUCCESS ) \
+ { \
+ throw std::runtime_error( AIRSPYHF_FORMAT_ERROR(ret, msg) ); \
+ }
+
+#define AIRSPYHF_FUNC_STR(func, arg) \
+ boost::str(boost::format(func "(%1%)") % arg) + " has failed"
+
+airspyhf_source_c_sptr make_airspyhf_source_c (const std::string & args)
+{
+ return gnuradio::get_initial_sptr(new airspyhf_source_c (args));
+}
+
+/*
+ * Specify constraints on number of input and output streams.
+ * This info is used to construct the input and output signatures
+ * (2nd & 3rd args to gr::block's constructor). The input and
+ * output signatures are used by the runtime system to
+ * check that a valid number and type of inputs and outputs
+ * are connected to this block. In this case, we accept
+ * only 0 input and 1 output.
+ */
+static const int MIN_IN = 0; // mininum number of input streams
+static const int MAX_IN = 0; // maximum number of input streams
+static const int MIN_OUT = 1; // minimum number of output streams
+static const int MAX_OUT = 1; // maximum number of output streams
+
+/*
+ * The private constructor
+ */
+airspyhf_source_c::airspyhf_source_c (const std::string &args)
+ : gr::sync_block ("airspyhf_source_c",
+ gr::io_signature::make(MIN_IN, MAX_IN, sizeof (gr_complex)),
+ gr::io_signature::make(MIN_OUT, MAX_OUT, sizeof (gr_complex))),
+ _dev(NULL),
+ _sample_rate(0),
+ _center_freq(0),
+ _freq_corr(0)
+{
+ int ret;
+
+ dict_t dict = params_to_dict(args);
+
+ _dev = NULL;
+ ret = airspyhf_open( &_dev );
+ AIRSPYHF_THROW_ON_ERROR(ret, "Failed to open Airspy HF+ device")
+
+ uint32_t num_rates;
+ airspyhf_get_samplerates(_dev, &num_rates, 0);
+ uint32_t *samplerates = (uint32_t *) malloc(num_rates * sizeof(uint32_t));
+ airspyhf_get_samplerates(_dev, samplerates, num_rates);
+ for (size_t i = 0; i < num_rates; i++)
+ _sample_rates.push_back( std::pair<double, uint32_t>( samplerates[i], i ) );
+ free(samplerates);
+
+ /* since they may (and will) give us an unsorted array we have to sort it here
+ * to play nice with the monotonic requirement of meta-range later on */
+ std::sort(_sample_rates.begin(), _sample_rates.end());
+
+ std::cerr << "Using libairspyhf" << AIRSPYHF_VERSION << ", samplerates: ";
+
+ for (size_t i = 0; i < _sample_rates.size(); i++)
+ std::cerr << boost::format("%gM ") % (_sample_rates[i].first / 1e6);
+
+ std::cerr << std::endl;
+
+ set_center_freq( (get_freq_range().start() + get_freq_range().stop()) / 2.0 );
+ set_sample_rate( get_sample_rates().start() );
+
+ _fifo = new boost::circular_buffer<gr_complex>(5000000);
+ if (!_fifo) {
+ throw std::runtime_error( std::string(__FUNCTION__) + " " +
+ "Failed to allocate a sample FIFO!" );
+ }
+}
+
+/*
+ * Our virtual destructor.
+ */
+airspyhf_source_c::~airspyhf_source_c ()
+{
+ int ret;
+
+ if (_dev) {
+ if ( airspyhf_is_streaming( _dev ) )
+ {
+ ret = airspyhf_stop( _dev );
+ if ( ret != AIRSPYHF_SUCCESS )
+ {
+ std::cerr << AIRSPYHF_FORMAT_ERROR(ret, "Failed to stop RX streaming") << std::endl;
+ }
+ }
+
+ ret = airspyhf_close( _dev );
+ if ( ret != AIRSPYHF_SUCCESS )
+ {
+ std::cerr << AIRSPYHF_FORMAT_ERROR(ret, "Failed to close AirSpy") << std::endl;
+ }
+ _dev = NULL;
+ }
+
+ if (_fifo)
+ {
+ delete _fifo;
+ _fifo = NULL;
+ }
+}
+
+int airspyhf_source_c::_airspyhf_rx_callback(airspyhf_transfer_t *transfer)
+{
+ airspyhf_source_c *obj = (airspyhf_source_c *)transfer->ctx;
+
+ return obj->airspyhf_rx_callback((float *)transfer->samples, transfer->sample_count);
+}
+
+int airspyhf_source_c::airspyhf_rx_callback(void *samples, int sample_count)
+{
+ size_t i, n_avail, to_copy, num_samples = sample_count;
+ float *sample = (float *)samples;
+
+ _fifo_lock.lock();
+
+ n_avail = _fifo->capacity() - _fifo->size();
+ to_copy = (n_avail < num_samples ? n_avail : num_samples);
+
+ for (i = 0; i < to_copy; i++ )
+ {
+ /* Push sample to the fifo */
+ _fifo->push_back( gr_complex( *sample, *(sample+1) ) );
+
+ /* offset to the next I+Q sample */
+ sample += 2;
+ }
+
+ _fifo_lock.unlock();
+
+ /* We have made some new samples available to the consumer in work() */
+ if (to_copy) {
+ //std::cerr << "+" << std::flush;
+ _samp_avail.notify_one();
+ }
+
+ /* Indicate overrun, if neccesary */
+ if (to_copy < num_samples)
+ std::cerr << "O" << std::flush;
+
+ return 0; // TODO: return -1 on error/stop
+}
+
+bool airspyhf_source_c::start()
+{
+ if ( ! _dev )
+ return false;
+
+ int ret = airspyhf_start( _dev, _airspyhf_rx_callback, (void *)this );
+ if ( ret != AIRSPYHF_SUCCESS ) {
+ std::cerr << "Failed to start RX streaming (" << ret << ")" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+bool airspyhf_source_c::stop()
+{
+ if ( ! _dev )
+ return false;
+
+ int ret = airspyhf_stop( _dev );
+ if ( ret != AIRSPYHF_SUCCESS ) {
+ std::cerr << "Failed to stop RX streaming (" << ret << ")" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+int airspyhf_source_c::work( int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items )
+{
+ gr_complex *out = (gr_complex *)output_items[0];
+
+ bool running = false;
+
+ if ( _dev )
+ running = airspyhf_is_streaming( _dev );
+
+ if ( ! running )
+ return WORK_DONE;
+
+ std::unique_lock<std::mutex> lock(_fifo_lock);
+
+ /* Wait until we have the requested number of samples */
+ int n_samples_avail = _fifo->size();
+
+ while (n_samples_avail < noutput_items) {
+ _samp_avail.wait(lock);
+ n_samples_avail = _fifo->size();
+ }
+
+ for(int i = 0; i < noutput_items; ++i) {
+ out[i] = _fifo->at(0);
+ _fifo->pop_front();
+ }
+
+ return noutput_items;
+}
+
+std::vector<std::string> airspyhf_source_c::get_devices()
+{
+ std::vector<std::string> devices;
+ std::string label;
+
+ int ret;
+ airspyhf_device *dev = NULL;
+ ret = airspyhf_open(&dev);
+ if ( AIRSPYHF_SUCCESS == ret )
+ {
+ std::string args = "airspyhf=0,label='AirspyHF'";
+ devices.push_back( args );
+ ret = airspyhf_close(dev);
+ }
+
+ return devices;
+}
+
+size_t airspyhf_source_c::get_num_channels()
+{
+ return 1;
+}
+
+osmosdr::meta_range_t airspyhf_source_c::get_sample_rates()
+{
+ osmosdr::meta_range_t range;
+
+ for (size_t i = 0; i < _sample_rates.size(); i++)
+ range += osmosdr::range_t( _sample_rates[i].first );
+
+ return range;
+}
+
+double airspyhf_source_c::set_sample_rate( double rate )
+{
+ int ret = AIRSPYHF_SUCCESS;
+
+ if (_dev) {
+ bool found_supported_rate = false;
+ uint32_t samp_rate_index = 0;
+
+ for( unsigned int i = 0; i < _sample_rates.size(); i++ )
+ {
+ if( _sample_rates[i].first == rate )
+ {
+ samp_rate_index = _sample_rates[i].second;
+
+ found_supported_rate = true;
+ }
+ }
+
+ if ( ! found_supported_rate )
+ {
+ throw std::runtime_error(
+ boost::str( boost::format("Unsupported samplerate: %gM") % (rate/1e6) ) );
+ }
+
+ ret = airspyhf_set_samplerate( _dev, samp_rate_index );
+ if ( AIRSPYHF_SUCCESS == ret ) {
+ _sample_rate = rate;
+ } else {
+ AIRSPYHF_THROW_ON_ERROR( ret, AIRSPYHF_FUNC_STR( "airspyhf_set_samplerate", rate ) )
+ }
+ }
+
+ return get_sample_rate();
+}
+
+double airspyhf_source_c::get_sample_rate()
+{
+ return _sample_rate;
+}
+
+osmosdr::freq_range_t airspyhf_source_c::get_freq_range( size_t chan )
+{
+ osmosdr::freq_range_t range;
+
+ range += osmosdr::range_t( 0.0, 260.0e6 );
+
+ return range;
+}
+
+double airspyhf_source_c::set_center_freq( double freq, size_t chan )
+{
+ int ret;
+
+ if (_dev) {
+ ret = airspyhf_set_freq( _dev, freq );
+ if ( AIRSPYHF_SUCCESS == ret ) {
+ _center_freq = freq;
+ } else {
+ AIRSPYHF_THROW_ON_ERROR( ret, AIRSPYHF_FUNC_STR( "airspyhf_set_freq", freq ) )
+ }
+ }
+
+ return get_center_freq( chan );
+}
+
+double airspyhf_source_c::get_center_freq( size_t chan )
+{
+ return _center_freq;
+}
+
+double airspyhf_source_c::set_freq_corr( double ppm, size_t chan )
+{
+ int ret;
+ int32_t ppb = (int32_t) (ppm * 1.0e3);
+
+ if (_dev) {
+ ret = airspyhf_set_calibration( _dev, ppb );
+ if ( AIRSPYHF_SUCCESS == ret ) {
+ _freq_corr = ppm;
+ } else {
+ AIRSPYHF_THROW_ON_ERROR( ret, AIRSPYHF_FUNC_STR( "airspyhf_set_calibration", ppm ) )
+ }
+ }
+
+ return ppm;
+}
+
+double airspyhf_source_c::get_freq_corr( size_t chan )
+{
+ return _freq_corr;
+}
+
+std::vector<std::string> airspyhf_source_c::get_gain_names( size_t chan )
+{
+ return {};
+}
+
+osmosdr::gain_range_t airspyhf_source_c::get_gain_range( size_t chan )
+{
+ return osmosdr::gain_range_t();
+}
+
+osmosdr::gain_range_t airspyhf_source_c::get_gain_range( const std::string & name, size_t chan )
+{
+ return osmosdr::gain_range_t();
+}
+
+
+double airspyhf_source_c::set_gain( double gain, size_t chan )
+{
+ return gain;
+}
+
+double airspyhf_source_c::set_gain( double gain, const std::string & name, size_t chan)
+{
+ return gain;
+}
+
+double airspyhf_source_c::get_gain( size_t chan )
+{
+ return 0.0;
+}
+
+double airspyhf_source_c::get_gain( const std::string & name, size_t chan )
+{
+ return 0.0;
+}
+
+std::vector< std::string > airspyhf_source_c::get_antennas( size_t chan )
+{
+ std::vector< std::string > antennas;
+
+ antennas += get_antenna( chan );
+
+ return antennas;
+}
+
+std::string airspyhf_source_c::set_antenna( const std::string & antenna, size_t chan )
+{
+ return get_antenna( chan );
+}
+
+std::string airspyhf_source_c::get_antenna( size_t chan )
+{
+ return "RX";
+}
diff --git a/lib/osmosdr/osmosdr_src_c.h b/lib/airspyhf/airspyhf_source_c.h
index 0f62b09..d9dd952 100644
--- a/lib/osmosdr/osmosdr_src_c.h
+++ b/lib/airspyhf/airspyhf_source_c.h
@@ -1,6 +1,8 @@
/* -*- c++ -*- */
/*
- * Copyright 2012 Dimitri Stolnikov <horiz0n@gmx.net>
+ * Copyright 2013 Dimitri Stolnikov <horiz0n@gmx.net>
+ *
+ * This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,65 +19,54 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_OSMOSDR_SRC_C_H
-#define INCLUDED_OSMOSDR_SRC_C_H
+#ifndef INCLUDED_AIRSPYHF_SOURCE_C_H
+#define INCLUDED_AIRSPYHF_SOURCE_C_H
+
+#include <boost/circular_buffer.hpp>
+
+#include <mutex>
+#include <condition_variable>
#include <gnuradio/sync_block.h>
-#include <gnuradio/thread/thread.h>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+#include <libairspyhf/airspyhf.h>
#include "source_iface.h"
-class osmosdr_src_c;
-typedef struct osmosdr_dev osmosdr_dev_t;
+class airspyhf_source_c;
-/*
- * We use boost::shared_ptr's instead of raw pointers for all access
- * to gr::blocks (and many other data structures). The shared_ptr gets
- * us transparent reference counting, which greatly simplifies storage
- * management issues. This is especially helpful in our hybrid
- * C++ / Python system.
- *
- * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
- *
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
- */
-typedef boost::shared_ptr<osmosdr_src_c> osmosdr_src_c_sptr;
+typedef std::shared_ptr<airspyhf_source_c> airspyhf_source_c_sptr;
/*!
- * \brief Return a shared_ptr to a new instance of osmosdr_src_c.
+ * \brief Return a shared_ptr to a new instance of airspyhf_source_c.
*
- * To avoid accidental use of raw pointers, osmosdr_src_c's
- * constructor is private. osmosdr_make_src_c is the public
+ * To avoid accidental use of raw pointers, airspyhf_source_c's
+ * constructor is private. make_airspyhf_source_c is the public
* interface for creating new instances.
*/
-osmosdr_src_c_sptr osmosdr_make_src_c (const std::string & args = "");
+airspyhf_source_c_sptr make_airspyhf_source_c (const std::string & args = "");
/*!
* \brief Provides a stream of complex samples.
* \ingroup block
- *
- * \sa sink for a version that subclasses gr::hier_block2.
*/
-class osmosdr_src_c :
+class airspyhf_source_c :
public gr::sync_block,
public source_iface
{
private:
- // The friend declaration allows osmosdr_make_src_c to
+ // The friend declaration allows make_airspyhf_source_c to
// access the private constructor.
- friend osmosdr_src_c_sptr osmosdr_make_src_c (const std::string & args);
+ friend airspyhf_source_c_sptr make_airspyhf_source_c (const std::string & args);
+
+ airspyhf_source_c (const std::string & args);
- /*!
- * \brief Provides a stream of complex samples.
- */
- osmosdr_src_c (const std::string & args); // private constructor
+public:
+ ~airspyhf_source_c ();
- public:
- ~osmosdr_src_c (); // public destructor
+ bool start();
+ bool stop();
int work( int noutput_items,
gr_vector_const_void_star &input_items,
@@ -98,42 +89,30 @@ private:
std::vector<std::string> get_gain_names( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
- bool set_gain_mode( bool automatic, size_t chan = 0 );
- bool get_gain_mode( size_t chan = 0 );
double set_gain( double gain, size_t chan = 0 );
double set_gain( double gain, const std::string & name, size_t chan = 0 );
double get_gain( size_t chan = 0 );
double get_gain( const std::string & name, size_t chan = 0 );
- double set_if_gain( double gain, size_t chan = 0 );
-
std::vector< std::string > get_antennas( size_t chan = 0 );
std::string set_antenna( const std::string & antenna, size_t chan = 0 );
std::string get_antenna( size_t chan = 0 );
+
private:
- static void _osmosdr_callback(unsigned char *buf, uint32_t len, void *ctx);
- void osmosdr_callback(unsigned char *buf, uint32_t len);
- static void _osmosdr_wait(osmosdr_src_c *obj);
- void osmosdr_wait();
-
- osmosdr_dev_t *_dev;
- gr::thread::thread _thread;
- unsigned short **_buf;
- unsigned int _buf_num;
- unsigned int _buf_len;
- unsigned int _buf_head;
- unsigned int _buf_used;
- boost::mutex _buf_mutex;
- boost::condition_variable _buf_cond;
- bool _running;
-
- unsigned int _buf_offset;
- int _samp_avail;
-
- bool _auto_gain;
- double _if_gain;
- unsigned int _skipped;
+ static int _airspyhf_rx_callback(airspyhf_transfer_t* transfer);
+ int airspyhf_rx_callback(void *samples, int sample_count);
+
+ airspyhf_device *_dev;
+
+ boost::circular_buffer<gr_complex> *_fifo;
+ std::mutex _fifo_lock;
+ std::condition_variable _samp_avail;
+
+ std::vector< std::pair<double, uint32_t> > _sample_rates;
+ double _sample_rate;
+ double _center_freq;
+ double _freq_corr;
};
-#endif /* INCLUDED_OSMOSDR_SRC_C_H */
+#endif /* INCLUDED_AIRSPY_SOURCE_C_H */
diff --git a/lib/arg_helpers.h b/lib/arg_helpers.h
index b971625..3b02b8f 100644
--- a/lib/arg_helpers.h
+++ b/lib/arg_helpers.h
@@ -29,7 +29,6 @@
#include <boost/lexical_cast.hpp>
#include <boost/tokenizer.hpp>
-#include <boost/foreach.hpp>
#include <ciso646>
typedef std::map< std::string, std::string > dict_t;
@@ -38,7 +37,7 @@ typedef std::pair< std::string, std::string > pair_t;
inline std::string dict_to_args_string( const dict_t &d )
{
std::string out;
- BOOST_FOREACH(const pair_t pair, d)
+ for (const pair_t pair : d)
{
if (not out.empty()) out += ",";
out += pair.first + "='" + pair.second + "'";
@@ -54,7 +53,7 @@ inline std::vector< std::string > args_to_vector( const std::string &args )
typedef boost::tokenizer< boost::escaped_list_separator<char> > tokenizer_t;
tokenizer_t tokens(args, separator);
- BOOST_FOREACH(std::string token, tokens)
+ for (std::string token : tokens)
result.push_back(token);
return result;
@@ -68,7 +67,7 @@ inline std::vector< std::string > params_to_vector( const std::string &params )
typedef boost::tokenizer< boost::escaped_list_separator<char> > tokenizer_t;
tokenizer_t tokens(params, separator);
- BOOST_FOREACH(std::string token, tokens)
+ for (std::string token : tokens)
result.push_back(token);
return result;
@@ -98,7 +97,7 @@ inline dict_t params_to_dict( const std::string &params )
dict_t result;
std::vector< std::string > param_list = params_to_vector( params );
- BOOST_FOREACH(std::string param, param_list)
+ for (std::string param : param_list)
{
pair_t pair = param_to_pair( param );
std::string value = pair.second;
@@ -124,7 +123,7 @@ inline gr::io_signature::sptr args_to_io_signature( const std::string &args )
size_t dev_nchan = 0;
std::vector< std::string > arg_list = args_to_vector( args );
- BOOST_FOREACH( std::string arg, arg_list )
+ for (std::string arg : arg_list)
{
if ( arg.find( "numchan=" ) == 0 ) // try to parse global nchan value
{
@@ -141,7 +140,7 @@ inline gr::io_signature::sptr args_to_io_signature( const std::string &args )
// try to parse device specific nchan values, assume 1 channel if none given
- BOOST_FOREACH( std::string arg, arg_list )
+ for (std::string arg : arg_list)
{
dict_t dict = params_to_dict(arg);
if (dict.count("nchan"))
diff --git a/lib/bladerf/CMakeLists.txt b/lib/bladerf/CMakeLists.txt
index c253a22..ea9cf49 100644
--- a/lib/bladerf/CMakeLists.txt
+++ b/lib/bladerf/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2013 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,20 +21,20 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${LIBBLADERF_INCLUDE_DIRS}
- ${VOLK_INCLUDE_DIRS}
+ ${Volk_INCLUDE_DIRS}
)
-set(bladerf_srcs
+APPEND_LIB_LIST(
+ ${LIBBLADERF_LIBRARIES}
+ ${Volk_LIBRARIES}
+)
+
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/bladerf_source_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/bladerf_sink_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/bladerf_common.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${bladerf_srcs})
-list(APPEND gr_osmosdr_libs ${LIBBLADERF_LIBRARIES} ${VOLK_LIBRARIES})
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/bladerf/bladerf_common.cc b/lib/bladerf/bladerf_common.cc
index c10cc2e..0548027 100644
--- a/lib/bladerf/bladerf_common.cc
+++ b/lib/bladerf/bladerf_common.cc
@@ -35,10 +35,8 @@
#include <string>
#include <boost/assign.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/weak_ptr.hpp>
#include "bladerf_common.h"
@@ -50,8 +48,8 @@ static size_t const STREAM_TIMEOUT_MS = 3000;
using namespace boost::assign;
-boost::mutex bladerf_common::_devs_mutex;
-std::list<boost::weak_ptr<struct bladerf>> bladerf_common::_devs;
+std::mutex bladerf_common::_devs_mutex;
+std::list<std::weak_ptr<struct bladerf> > bladerf_common::_devs;
/* name for system-wide gain (which is not its own libbladeRF gain stage) */
static const char *SYSTEM_GAIN_NAME = "system";
@@ -135,7 +133,7 @@ size_t num_streams(bladerf_channel_layout layout)
* Public methods
******************************************************************************/
bladerf_common::bladerf_common() :
- _dev(NULL),
+ _dev(std::shared_ptr<struct bladerf>()),
_pfx("[bladeRF common] "),
_failures(0),
_num_buffers(NUM_BUFFERS),
@@ -414,7 +412,7 @@ size_t bladerf_common::get_max_channels(bladerf_direction direction)
#ifdef BLADERF_COMPATIBILITY
return 1;
#else
- return bladerf_get_channel_count(_dev.get(), (BLADERF_TX == direction));
+ return bladerf_get_channel_count(_dev.get(), direction);
#endif
}
@@ -499,7 +497,7 @@ int bladerf_common::channel2rfport(bladerf_channel ch)
bladerf_channel bladerf_common::chan2channel(bladerf_direction direction,
size_t chan)
{
- BOOST_FOREACH(bladerf_channel_map::value_type &i, _chanmap) {
+ for (bladerf_channel_map::value_type &i : _chanmap) {
bladerf_channel ch = i.first;
if (
(i.second == (int)chan) && (
@@ -526,7 +524,7 @@ osmosdr::meta_range_t bladerf_common::sample_rates(bladerf_channel ch)
#else
int status;
- bladerf_range brf_sample_rates;
+ const bladerf_range *brf_sample_rates;
status = bladerf_get_sample_rate_range(_dev.get(), ch, &brf_sample_rates);
if (status != 0) {
@@ -534,15 +532,15 @@ osmosdr::meta_range_t bladerf_common::sample_rates(bladerf_channel ch)
}
/* Suggest a variety of sample rates */
- sample_rates += osmosdr::range_t(brf_sample_rates.min,
- brf_sample_rates.max / 4.0,
- brf_sample_rates.max / 16.0);
- sample_rates += osmosdr::range_t(brf_sample_rates.max / 4.0,
- brf_sample_rates.max / 2.0,
- brf_sample_rates.max / 8.0);
- sample_rates += osmosdr::range_t(brf_sample_rates.max / 2.0,
- brf_sample_rates.max,
- brf_sample_rates.max / 4.0);
+ sample_rates += osmosdr::range_t(brf_sample_rates->min,
+ brf_sample_rates->max / 4.0,
+ brf_sample_rates->max / 16.0);
+ sample_rates += osmosdr::range_t(brf_sample_rates->max / 4.0,
+ brf_sample_rates->max / 2.0,
+ brf_sample_rates->max / 8.0);
+ sample_rates += osmosdr::range_t(brf_sample_rates->max / 2.0,
+ brf_sample_rates->max,
+ brf_sample_rates->max / 4.0);
#endif
return sample_rates;
@@ -587,16 +585,16 @@ osmosdr::freq_range_t bladerf_common::freq_range(bladerf_channel ch)
#else
int status;
- struct bladerf_range range;
+ const struct bladerf_range *range;
status = bladerf_get_frequency_range(_dev.get(), ch, &range);
if (status != 0) {
BLADERF_THROW_STATUS(status, "bladerf_get_frequency_range failed");
};
- return osmosdr::freq_range_t(static_cast<double>(range.min),
- static_cast<double>(range.max),
- static_cast<double>(range.step));
+ return osmosdr::freq_range_t(static_cast<double>(range->min),
+ static_cast<double>(range->max),
+ static_cast<double>(range->step));
#endif
}
@@ -643,19 +641,19 @@ osmosdr::freq_range_t bladerf_common::filter_bandwidths(bladerf_channel ch)
0.75, 0.875, 1.25, 1.375, 1.5, 1.92, 2.5,
2.75, 3, 3.5, 4.375, 5, 6, 7, 10, 14;
- BOOST_FOREACH( double half_bw, half_bandwidths )
+ for (double half_bw : half_bandwidths)
bandwidths += osmosdr::range_t( half_bw * 2e6 );
#else
int status;
- bladerf_range range;
+ const bladerf_range *range;
status = bladerf_get_bandwidth_range(_dev.get(), ch, &range);
if (status != 0) {
BLADERF_THROW_STATUS(status, "bladerf_get_bandwidth_range failed");
}
- bandwidths += osmosdr::range_t(range.min, range.max, range.step);
+ bandwidths += osmosdr::range_t(range->min, range->max, range->step);
#endif
return bandwidths;
@@ -717,6 +715,7 @@ std::vector<std::string> bladerf_common::get_gain_names(bladerf_channel ch)
for (int i = 0; i < count; ++i) {
char *tmp = gain_names[i];
+ printf("FOUND %s\n", tmp);
names += std::string(tmp);
};
#endif
@@ -747,7 +746,7 @@ osmosdr::gain_range_t bladerf_common::get_gain_range(std::string const &name,
#else
int status;
- struct bladerf_range range;
+ const bladerf_range *range;
if (name == SYSTEM_GAIN_NAME) {
status = bladerf_get_gain_range(_dev.get(), ch, &range);
@@ -760,7 +759,7 @@ osmosdr::gain_range_t bladerf_common::get_gain_range(std::string const &name,
"range for stage '%s'") % name));
}
- return osmosdr::gain_range_t(range.min, range.max, range.step);
+ return osmosdr::gain_range_t(range->min, range->max, range->step);
#endif
}
@@ -1078,7 +1077,7 @@ bladerf_sptr bladerf_common::open(std::string const &device_name)
struct bladerf *raw_dev = NULL;
struct bladerf_devinfo devinfo;
- boost::unique_lock<boost::mutex> lock(_devs_mutex);
+ std::lock_guard<std::mutex> lock(_devs_mutex);
/* Initialize the information used to identify the desired device
* to all wildcard (i.e., "any device") values */
@@ -1108,15 +1107,15 @@ bladerf_sptr bladerf_common::open(std::string const &device_name)
/* Add the device handle to our cache */
bladerf_sptr dev = bladerf_sptr(raw_dev, bladerf_common::close);
- _devs.push_back(static_cast<boost::weak_ptr<struct bladerf>>(dev));
+ _devs.push_back(static_cast<std::weak_ptr<struct bladerf> >(dev));
return dev;
}
void bladerf_common::close(void *dev)
{
- boost::unique_lock<boost::mutex> lock(_devs_mutex);
- std::list<boost::weak_ptr<struct bladerf>>::iterator it(_devs.begin());
+ std::lock_guard<std::mutex> lock(_devs_mutex);
+ std::list<std::weak_ptr<struct bladerf> >::iterator it(_devs.begin());
/* Prune expired entries from device cache */
while (it != _devs.end()) {
@@ -1136,7 +1135,7 @@ bladerf_sptr bladerf_common::get_cached_device(struct bladerf_devinfo devinfo)
int status;
struct bladerf_devinfo other_devinfo;
- BOOST_FOREACH(boost::weak_ptr<struct bladerf> dev, _devs) {
+ for (std::weak_ptr<struct bladerf> dev : _devs) {
status = bladerf_get_devinfo(bladerf_sptr(dev).get(), &other_devinfo);
if (status < 0) {
BLADERF_THROW_STATUS(status, "Failed to get devinfo for cached device");
@@ -1199,7 +1198,7 @@ void bladerf_common::print_device_info()
bool bladerf_common::is_antenna_valid(bladerf_direction dir,
const std::string &antenna)
{
- BOOST_FOREACH(std::string ant, get_antennas(dir)) {
+ for (std::string ant : get_antennas(dir)) {
if (antenna == ant) {
return true;
}
diff --git a/lib/bladerf/bladerf_common.h b/lib/bladerf/bladerf_common.h
index 27afa83..32e8101 100644
--- a/lib/bladerf/bladerf_common.h
+++ b/lib/bladerf/bladerf_common.h
@@ -23,12 +23,11 @@
#include <list>
#include <map>
+#include <memory>
+#include <mutex>
#include <string>
#include <vector>
-#include <boost/thread/mutex.hpp>
-#include <boost/weak_ptr.hpp>
-
#include <libbladeRF.h>
#include "osmosdr/ranges.h"
@@ -43,7 +42,7 @@ typedef ptrdiff_t ssize_t;
#define BLADERF_DEBUG_ENABLE
-typedef boost::shared_ptr<struct bladerf> bladerf_sptr;
+typedef std::shared_ptr<struct bladerf> bladerf_sptr;
/* Identification of the bladeRF hardware in use */
typedef enum {
@@ -287,8 +286,8 @@ private:
/*****************************************************************************
* Private members
****************************************************************************/
- static boost::mutex _devs_mutex; /**< mutex for access to _devs */
- static std::list<boost::weak_ptr<struct bladerf>> _devs; /**< dev cache */
+ static std::mutex _devs_mutex; /**< mutex for access to _devs */
+ static std::list<std::weak_ptr<struct bladerf> > _devs; /**< dev cache */
};
#endif
diff --git a/lib/bladerf/bladerf_compat.h b/lib/bladerf/bladerf_compat.h
index 2ad24be..45e6a16 100644
--- a/lib/bladerf/bladerf_compat.h
+++ b/lib/bladerf/bladerf_compat.h
@@ -66,7 +66,7 @@
}
/* Changed enums/defines */
- #define BLADERF_GAIN_DEFAULT BLADERF_GAIN_AUTOMATIC
+ #define BLADERF_GAIN_DEFAULT BLADERF_GAIN_MANUAL
#define BLADERF_GAIN_MGC BLADERF_GAIN_MANUAL
#define BLADERF_RX_MUX_BASEBAND BLADERF_RX_MUX_BASEBAND_LMS
diff --git a/lib/bladerf/bladerf_sink_c.cc b/lib/bladerf/bladerf_sink_c.cc
index fe64439..71d9eaa 100644
--- a/lib/bladerf/bladerf_sink_c.cc
+++ b/lib/bladerf/bladerf_sink_c.cc
@@ -96,7 +96,7 @@ bladerf_sink_c::bladerf_sink_c(const std::string &args) :
}
/* Initialize channel <-> antenna map */
- BOOST_FOREACH(std::string ant, get_antennas()) {
+ for (std::string ant : get_antennas()) {
_chanmap[str2channel(ant)] = -1;
}
@@ -174,11 +174,9 @@ bool bladerf_sink_c::start()
for (size_t ch = 0; ch < get_max_channels(); ++ch) {
bladerf_channel brfch = BLADERF_CHANNEL_TX(ch);
- if (get_channel_enable(brfch)) {
- status = bladerf_enable_module(_dev.get(), brfch, true);
- if (status != 0) {
- BLADERF_THROW_STATUS(status, "bladerf_enable_module failed");
- }
+ status = bladerf_enable_module(_dev.get(), brfch, get_channel_enable(brfch));
+ if (status != 0) {
+ BLADERF_THROW_STATUS(status, "bladerf_enable_module failed");
}
}
@@ -210,11 +208,9 @@ bool bladerf_sink_c::stop()
for (size_t ch = 0; ch < get_max_channels(); ++ch) {
bladerf_channel brfch = BLADERF_CHANNEL_TX(ch);
- if (get_channel_enable(brfch)) {
- status = bladerf_enable_module(_dev.get(), brfch, false);
- if (status != 0) {
- BLADERF_THROW_STATUS(status, "bladerf_enable_module failed");
- }
+ status = bladerf_enable_module(_dev.get(), brfch, get_channel_enable(brfch));
+ if (status != 0) {
+ BLADERF_THROW_STATUS(status, "bladerf_enable_module failed");
}
}
@@ -329,7 +325,7 @@ int bladerf_sink_c::transmit_with_tags(int16_t const *samples,
}
}
- BOOST_FOREACH(gr::tag_t tag, tags) {
+ for (gr::tag_t tag : tags) {
// Upon seeing an SOB tag, update our offset. We'll TX the start of the
// burst when we see an EOB or at the end of this function - whichever
// occurs first.
diff --git a/lib/bladerf/bladerf_sink_c.h b/lib/bladerf/bladerf_sink_c.h
index 9f8a496..268f8df 100644
--- a/lib/bladerf/bladerf_sink_c.h
+++ b/lib/bladerf/bladerf_sink_c.h
@@ -30,7 +30,7 @@
class bladerf_sink_c;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -38,9 +38,9 @@ class bladerf_sink_c;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<bladerf_sink_c> bladerf_sink_c_sptr;
+typedef std::shared_ptr<bladerf_sink_c> bladerf_sink_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of bladerf_sink_c.
diff --git a/lib/bladerf/bladerf_source_c.cc b/lib/bladerf/bladerf_source_c.cc
index fb7d42c..dd366cd 100644
--- a/lib/bladerf/bladerf_source_c.cc
+++ b/lib/bladerf/bladerf_source_c.cc
@@ -112,6 +112,15 @@ bladerf_source_c::bladerf_source_c(const std::string &args) :
/* RX Mux */
set_rx_mux_mode(dict.count("rxmux") ? dict["rxmux"] : "baseband");
+ /* Ref in frequency */
+ if (dict.count("refin_freq")) {
+ status = bladerf_set_pll_refclk(_dev.get(), boost::lexical_cast< uint64_t >(dict["refin_freq"]));
+ if (status != 0) {
+ BLADERF_WARNING("Problem while setting refin_freq: " <<
+ bladerf_strerror(status));
+ }
+ }
+
/* AGC mode */
if (dict.count("agc_mode")) {
set_agc_mode(dict["agc_mode"]);
@@ -144,7 +153,7 @@ bladerf_source_c::bladerf_source_c(const std::string &args) :
}
/* Initialize channel <-> antenna map */
- BOOST_FOREACH(std::string ant, get_antennas()) {
+ for (std::string ant : get_antennas()) {
_chanmap[str2channel(ant)] = -1;
}
@@ -180,7 +189,7 @@ bladerf_source_c::bladerf_source_c(const std::string &args) :
bool bladerf_source_c::is_antenna_valid(const std::string &antenna)
{
- BOOST_FOREACH(std::string ant, get_antennas()) {
+ for (std::string ant : get_antennas()) {
if (antenna == ant) {
return true;
}
@@ -230,11 +239,9 @@ bool bladerf_source_c::start()
for (size_t ch = 0; ch < get_max_channels(); ++ch) {
bladerf_channel brfch = BLADERF_CHANNEL_RX(ch);
- if (get_channel_enable(brfch)) {
- status = bladerf_enable_module(_dev.get(), brfch, true);
- if (status != 0) {
- BLADERF_THROW_STATUS(status, "bladerf_enable_module failed");
- }
+ status = bladerf_enable_module(_dev.get(), brfch, get_channel_enable(brfch));
+ if (status != 0) {
+ BLADERF_THROW_STATUS(status, "bladerf_enable_module failed");
}
}
@@ -344,7 +351,7 @@ int bladerf_source_c::work(int noutput_items,
memcpy(out[0], _32fcbuf, sizeof(gr_complex) * noutput_items);
}
- return noutput_items;
+ return noutput_items/(get_num_channels());
}
osmosdr::meta_range_t bladerf_source_c::get_sample_rates()
@@ -594,8 +601,8 @@ void bladerf_source_c::set_loopback_mode(const std::string &loopback)
mode = BLADERF_LB_RF_LNA3;
} else if (loopback == "firmware") {
mode = BLADERF_LB_FIRMWARE;
- } else if (loopback == "ad9361_bist") {
- mode = BLADERF_LB_AD9361_BIST;
+ } else if (loopback == "rfic_bist") {
+ mode = BLADERF_LB_RFIC_BIST;
} else if (loopback == "none") {
mode = BLADERF_LB_NONE;
} else {
diff --git a/lib/bladerf/bladerf_source_c.h b/lib/bladerf/bladerf_source_c.h
index 05f9ddf..0cc26f4 100644
--- a/lib/bladerf/bladerf_source_c.h
+++ b/lib/bladerf/bladerf_source_c.h
@@ -30,7 +30,7 @@
class bladerf_source_c;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -38,9 +38,9 @@ class bladerf_source_c;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<bladerf_source_c> bladerf_source_c_sptr;
+typedef std::shared_ptr<bladerf_source_c> bladerf_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of bladerf_source_c.
diff --git a/lib/config.h.in b/lib/config.h.in
index 42e72f1..4e63444 100644
--- a/lib/config.h.in
+++ b/lib/config.h.in
@@ -4,7 +4,6 @@
#define GR_OSMOSDR_VERSION "@VERSION@"
#define GR_OSMOSDR_LIBVER "@LIBVER@"
-#cmakedefine ENABLE_OSMOSDR
#cmakedefine ENABLE_FCD
#cmakedefine ENABLE_FILE
#cmakedefine ENABLE_RTL
@@ -16,9 +15,11 @@
#cmakedefine ENABLE_BLADERF
#cmakedefine ENABLE_RFSPACE
#cmakedefine ENABLE_AIRSPY
+#cmakedefine ENABLE_AIRSPYHF
#cmakedefine ENABLE_SOAPY
#cmakedefine ENABLE_REDPITAYA
#cmakedefine ENABLE_FREESRP
+#cmakedefine ENABLE_XTRX
//provide NAN define for MSVC older than VC12
#if defined(_MSC_VER) && (_MSC_VER < 1800)
diff --git a/lib/device.cc b/lib/device.cc
index 025a22b..1dee01f 100644
--- a/lib/device.cc
+++ b/lib/device.cc
@@ -20,20 +20,15 @@
#include <osmosdr/device.h>
#include <stdexcept>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
-#include <boost/thread/mutex.hpp>
#include <algorithm>
+#include <mutex>
#include <sstream>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef ENABLE_OSMOSDR
-#include <osmosdr_src_c.h>
-#endif
-
#ifdef ENABLE_FCD
#include <fcd_source_c.h>
#endif
@@ -78,6 +73,10 @@
#include <airspy_source_c.h>
#endif
+#ifdef ENABLE_AIRSPYHF
+#include <airspyhf_source_c.h>
+#endif
+
#ifdef ENABLE_SOAPY
#include <soapy_source_c.h>
#endif
@@ -98,13 +97,13 @@ static const std::string args_delim = " ";
static const std::string pairs_delim = ",";
static const std::string pair_delim = "=";
-static boost::mutex _device_mutex;
+static std::mutex _device_mutex;
device_t::device_t(const std::string &args)
{
dict_t dict = params_to_dict(args);
- BOOST_FOREACH( dict_t::value_type &entry, dict )
+ for (dict_t::value_type &entry : dict)
(*this)[entry.first] = entry.second;
}
@@ -114,7 +113,7 @@ std::string device_t::to_pp_string(void) const
std::stringstream ss;
ss << "Device Address:" << std::endl;
- BOOST_FOREACH(const device_t::value_type &entry, *this) {
+ for (const device_t::value_type &entry : *this) {
ss << boost::format(" %s: %s") % entry.first % entry.second << std::endl;
}
return ss.str();
@@ -124,7 +123,7 @@ std::string device_t::to_string(void) const
{
std::stringstream ss;
size_t count = 0;
- BOOST_FOREACH(const device_t::value_type &entry, *this) {
+ for (const device_t::value_type &entry : *this) {
std::string value = entry.second;
if (value.find(" ") != std::string::npos)
value = "'" + value + "'";
@@ -137,7 +136,7 @@ std::string device_t::to_string(void) const
devices_t device::find(const device_t &hint)
{
- boost::mutex::scoped_lock lock(_device_mutex);
+ std::lock_guard<std::mutex> lock(_device_mutex);
bool fake = true;
@@ -146,52 +145,52 @@ devices_t device::find(const device_t &hint)
devices_t devices;
-#ifdef ENABLE_OSMOSDR
- BOOST_FOREACH( std::string dev, osmosdr_src_c::get_devices() )
- devices.push_back( device_t(dev) );
-#endif
#ifdef ENABLE_FCD
- BOOST_FOREACH( std::string dev, fcd_source_c::get_devices() )
+ for (std::string dev : fcd_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_RTL
- BOOST_FOREACH( std::string dev, rtl_source_c::get_devices() )
+ for (std::string dev : rtl_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_UHD
- BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
+ for (std::string dev : uhd_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_MIRI
- BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
+ for (std::string dev : miri_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_SDRPLAY
- BOOST_FOREACH( std::string dev, sdrplay_source_c::get_devices() )
+ for (std::string dev : sdrplay_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_BLADERF
- BOOST_FOREACH( std::string dev, bladerf_source_c::get_devices() )
+ for (std::string dev : bladerf_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_HACKRF
- BOOST_FOREACH( std::string dev, hackrf_source_c::get_devices() )
+ for (std::string dev : hackrf_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_RFSPACE
- BOOST_FOREACH( std::string dev, rfspace_source_c::get_devices( fake ) )
+ for (std::string dev : rfspace_source_c::get_devices( fake ))
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_AIRSPY
- BOOST_FOREACH( std::string dev, airspy_source_c::get_devices() )
+ for (std::string dev : airspy_source_c::get_devices())
+ devices.push_back( device_t(dev) );
+#endif
+#ifdef ENABLE_AIRSPYHF
+ for (std::string dev : airspyhf_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_FREESRP
- BOOST_FOREACH( std::string dev, freesrp_source_c::get_devices() )
+ for (std::string dev : freesrp_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_SOAPY
- BOOST_FOREACH( std::string dev, soapy_source_c::get_devices() )
+ for (std::string dev : soapy_source_c::get_devices())
devices.push_back( device_t(dev) );
#endif
@@ -200,15 +199,15 @@ devices_t device::find(const device_t &hint)
* in a graphical interface etc... */
#ifdef ENABLE_RTL_TCP
- BOOST_FOREACH( std::string dev, rtl_tcp_source_c::get_devices( fake ) )
+ for (std::string dev : rtl_tcp_source_c::get_devices( fake ))
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_REDPITAYA
- BOOST_FOREACH( std::string dev, redpitaya_source_c::get_devices( fake ) )
+ for (std::string dev : redpitaya_source_c::get_devices( fake ))
devices.push_back( device_t(dev) );
#endif
#ifdef ENABLE_FILE
- BOOST_FOREACH( std::string dev, file_source_c::get_devices( fake ) )
+ for (std::string dev : file_source_c::get_devices( fake ))
devices.push_back( device_t(dev) );
#endif
diff --git a/lib/fcd/CMakeLists.txt b/lib/fcd/CMakeLists.txt
index e71b153..759e3aa 100644
--- a/lib/fcd/CMakeLists.txt
+++ b/lib/fcd/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,29 +21,16 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
-if(ENABLE_FCD)
-include_directories(${GNURADIO_FCD_INCLUDE_DIRS})
-endif(ENABLE_FCD)
+target_include_directories(gnuradio-osmosdr PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${GNURADIO_FUNCUBE_INCLUDE_DIRS}
+)
-if(ENABLE_FCDPP)
-include_directories(${GNURADIO_FCDPP_INCLUDE_DIRS})
-endif(ENABLE_FCDPP)
+APPEND_LIB_LIST(
+ ${GNURADIO_FUNCUBE_LIBRARIES}
+)
-set(fcd_srcs
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/fcd_source_c.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${fcd_srcs})
-
-if(ENABLE_FCD)
-list(APPEND gr_osmosdr_libs ${GNURADIO_FCD_LIBRARIES})
-endif(ENABLE_FCD)
-
-if(ENABLE_FCDPP)
-list(APPEND gr_osmosdr_libs ${GNURADIO_FCDPP_LIBRARIES})
-endif(ENABLE_FCDPP)
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/fcd/fcd_source_c.cc b/lib/fcd/fcd_source_c.cc
index 885d514..5eea677 100644
--- a/lib/fcd/fcd_source_c.cc
+++ b/lib/fcd/fcd_source_c.cc
@@ -23,7 +23,6 @@
#include <sstream>
#include <boost/assign.hpp>
-#include <boost/foreach.hpp>
#include <gnuradio/io_signature.h>
@@ -142,28 +141,24 @@ fcd_source_c::fcd_source_c(const std::string &args) :
std::cerr << "Using " << name() << " (" << dev_name << ")" << std::endl;
-#ifdef HAVE_FCD
if ( FUNCUBE_V1 == _type )
{
- _src_v1 = gr::fcd::source_c::make( dev_name );
+ _src_v1 = gr::funcube::fcd::make( dev_name );
connect( _src_v1, 0, self(), 0 );
set_gain( 20, "LNA" );
set_gain( 12, "MIX" );
}
-#endif
-#ifdef HAVE_FCDPP
if ( FUNCUBE_V2 == _type )
{
- _src_v2 = gr::fcdproplus::fcdproplus::make( dev_name );
+ _src_v2 = gr::funcube::fcdpp::make( dev_name );
connect( _src_v2, 0, self(), 0 );
set_gain( 1, "LNA" );
set_gain( 1, "MIX" );
set_gain( 15, "BB" );
}
-#endif
}
fcd_source_c::~fcd_source_c()
@@ -175,7 +170,7 @@ std::vector< std::string > fcd_source_c::get_devices()
int id = 0;
std::vector< std::string > devices;
- BOOST_FOREACH( device_t dev, _get_devices() )
+ for (device_t dev : _get_devices())
{
std::string args = "fcd=" + boost::lexical_cast< std::string >( id++ );
@@ -241,15 +236,11 @@ osmosdr::freq_range_t fcd_source_c::get_freq_range( size_t chan )
double fcd_source_c::set_center_freq( double freq, size_t chan )
{
-#ifdef HAVE_FCD
if ( FUNCUBE_V1 == _type )
- _src_v1->set_freq( float(freq) );
-#endif
+ _src_v1->set_freq( freq );
-#ifdef HAVE_FCDPP
if ( FUNCUBE_V2 == _type )
- _src_v2->set_freq( float(freq) );
-#endif
+ _src_v2->set_freq( freq );
_freq = freq;
@@ -263,15 +254,11 @@ double fcd_source_c::get_center_freq( size_t chan )
double fcd_source_c::set_freq_corr( double ppm, size_t chan )
{
-#ifdef HAVE_FCD
if ( FUNCUBE_V1 == _type )
_src_v1->set_freq_corr( ppm );
-#endif
-#ifdef HAVE_FCDPP
if ( FUNCUBE_V2 == _type )
_src_v2->set_freq_corr( ppm );
-#endif
_correct = ppm;
@@ -343,7 +330,6 @@ double fcd_source_c::set_gain( double gain, size_t chan )
double fcd_source_c::set_gain( double gain, const std::string & name, size_t chan )
{
-#ifdef HAVE_FCD
if ( FUNCUBE_V1 == _type )
{
if ( "LNA" == name )
@@ -357,9 +343,7 @@ double fcd_source_c::set_gain( double gain, const std::string & name, size_t cha
_src_v1->set_mixer_gain(_mix_gain);
}
}
-#endif
-#ifdef HAVE_FCDPP
if ( FUNCUBE_V2 == _type )
{
if ( "LNA" == name )
@@ -378,7 +362,6 @@ double fcd_source_c::set_gain( double gain, const std::string & name, size_t cha
_src_v2->set_if_gain(_bb_gain);
}
}
-#endif
return get_gain( name, chan );
}
diff --git a/lib/fcd/fcd_source_c.h b/lib/fcd/fcd_source_c.h
index 70239f8..7028693 100644
--- a/lib/fcd/fcd_source_c.h
+++ b/lib/fcd/fcd_source_c.h
@@ -22,19 +22,14 @@
#include <gnuradio/hier_block2.h>
-#ifdef HAVE_FCD
-#include <gnuradio/fcd/source_c.h>
-#endif
-
-#ifdef HAVE_FCDPP
-#include <fcdproplus/fcdproplus.h>
-#endif
+#include <funcube/fcd.h>
+#include <funcube/fcdpp.h>
#include "source_iface.h"
class fcd_source_c;
-typedef boost::shared_ptr< fcd_source_c > fcd_source_c_sptr;
+typedef std::shared_ptr< fcd_source_c > fcd_source_c_sptr;
fcd_source_c_sptr make_fcd_source_c( const std::string & args = "" );
@@ -86,14 +81,10 @@ public:
private:
dongle_type _type;
-#ifdef HAVE_FCD
- gr::fcd::source_c::sptr _src_v1;
-#endif
-#ifdef HAVE_FCDPP
- gr::fcdproplus::fcdproplus::sptr _src_v2;
-#endif
+ gr::funcube::fcd::sptr _src_v1;
+ gr::funcube::fcdpp::sptr _src_v2;
double _lna_gain, _mix_gain, _bb_gain, _freq;
- int _correct;
+ double _correct;
};
#endif // FCD_SOURCE_C_H
diff --git a/lib/file/CMakeLists.txt b/lib/file/CMakeLists.txt
index 6c55e85..c96632d 100644
--- a/lib/file/CMakeLists.txt
+++ b/lib/file/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,18 +21,17 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
-set(file_srcs
+APPEND_LIB_LIST(
+ gnuradio::gnuradio-blocks
+)
+message(STATUS ${gnuradio-blocks_LIBRARIES})
+
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/file_source_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/file_sink_c.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${file_srcs})
-#list(APPEND gr_osmosdr_libs ${GNURADIO_BLOCKS_LIBRARIES})
-
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/file/file_sink_c.h b/lib/file/file_sink_c.h
index 6e59451..dac30f0 100644
--- a/lib/file/file_sink_c.h
+++ b/lib/file/file_sink_c.h
@@ -28,7 +28,7 @@
class file_sink_c;
-typedef boost::shared_ptr< file_sink_c > file_sink_c_sptr;
+typedef std::shared_ptr< file_sink_c > file_sink_c_sptr;
file_sink_c_sptr make_file_sink_c( const std::string & args = "" );
diff --git a/lib/file/file_source_c.h b/lib/file/file_source_c.h
index 3e03037..b3d8b47 100644
--- a/lib/file/file_source_c.h
+++ b/lib/file/file_source_c.h
@@ -28,7 +28,7 @@
class file_source_c;
-typedef boost::shared_ptr< file_source_c > file_source_c_sptr;
+typedef std::shared_ptr< file_source_c > file_source_c_sptr;
file_source_c_sptr make_file_source_c( const std::string & args = "" );
diff --git a/lib/freesrp/CMakeLists.txt b/lib/freesrp/CMakeLists.txt
index 46df7e4..aca0d8c 100644
--- a/lib/freesrp/CMakeLists.txt
+++ b/lib/freesrp/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,19 +21,18 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${LIBFREESRP_INCLUDE_DIRS}
)
-set(freesrp_srcs
+APPEND_LIB_LIST(
+ ${LIBFREESRP_LIBRARIES}
+)
+
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/freesrp_common.cc
${CMAKE_CURRENT_SOURCE_DIR}/freesrp_source_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/freesrp_sink_c.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${freesrp_srcs})
-list(APPEND gr_osmosdr_libs ${LIBFREESRP_LIBRARIES})
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/freesrp/freesrp_common.cc b/lib/freesrp/freesrp_common.cc
index d60fbb8..1eeab5c 100644
--- a/lib/freesrp/freesrp_common.cc
+++ b/lib/freesrp/freesrp_common.cc
@@ -2,18 +2,15 @@
#include <cstdlib>
-#include <boost/make_shared.hpp>
#include <boost/assign.hpp>
#include <arg_helpers.h>
-using namespace FreeSRP;
-using namespace std;
using namespace boost::assign;
-boost::shared_ptr<::FreeSRP::FreeSRP> freesrp_common::_srp;
+std::shared_ptr<::FreeSRP::FreeSRP> freesrp_common::_srp;
-freesrp_common::freesrp_common(const string &args)
+freesrp_common::freesrp_common(const std::string &args)
{
dict_t dict = params_to_dict(args);
@@ -21,7 +18,7 @@ freesrp_common::freesrp_common(const string &args)
{
try
{
- string serial = "";
+ std::string serial = "";
if(dict.count("freesrp"))
{
@@ -30,22 +27,22 @@ freesrp_common::freesrp_common(const string &args)
if(dict.count("fx3"))
{
- if(Util::find_fx3())
+ if(FreeSRP::Util::find_fx3())
{
// Upload firmware to FX3
- string firmware_path = string(getenv("HOME")) + "/.freesrp/fx3.img";
+ std::string firmware_path = std::string(getenv("HOME")) + "/.freesrp/fx3.img";
if(dict["fx3"].length() > 0)
{
firmware_path = dict["fx3"];
}
- Util::find_fx3(true, firmware_path);
- cout << "FX3 programmed with '" << firmware_path << "'" << endl;
+ FreeSRP::Util::find_fx3(true, firmware_path);
+ std::cout << "FX3 programmed with '" << firmware_path << "'" << std::endl;
// Give FX3 time to re-enumerate
- this_thread::sleep_for(chrono::milliseconds(600));
+ std::this_thread::sleep_for(std::chrono::milliseconds(600));
}
else
{
- cout << "No FX3 in bootloader mode found" << endl;
+ std::cout << "No FX3 in bootloader mode found" << std::endl;
}
}
@@ -53,45 +50,45 @@ freesrp_common::freesrp_common(const string &args)
if(dict.count("fpga") || !_srp->fpga_loaded())
{
- string bitstream_path = string(getenv("HOME")) + "/.freesrp/fpga.bin";
+ std::string bitstream_path = std::string(getenv("HOME")) + "/.freesrp/fpga.bin";
if(dict["fpga"].length() > 0)
{
bitstream_path = dict["fpga"];
}
- fpga_status stat = _srp->load_fpga(bitstream_path);
+ FreeSRP::fpga_status stat = _srp->load_fpga(bitstream_path);
switch(stat)
{
- case FPGA_CONFIG_ERROR:
- throw runtime_error("Could not load FPGA configuration!");
- case FPGA_CONFIG_SKIPPED:
- cout << "FPGA already configured. Restart the FreeSRP to load a new bitstream." << endl;
+ case FreeSRP::FPGA_CONFIG_ERROR:
+ throw std::runtime_error("Could not load FPGA configuration!");
+ case FreeSRP::FPGA_CONFIG_SKIPPED:
+ std::cout << "FPGA already configured. Restart the FreeSRP to load a new bitstream." << std::endl;
break;
- case FPGA_CONFIG_DONE:
- cout << "FPGA configured with '" << bitstream_path << "'" << endl;
+ case FreeSRP::FPGA_CONFIG_DONE:
+ std::cout << "FPGA configured with '" << bitstream_path << "'" << std::endl;
break;
}
}
- cout << "Connected to FreeSRP" << endl;
+ std::cout << "Connected to FreeSRP" << std::endl;
if(dict.count("loopback"))
{
- response res = _srp->send_cmd({SET_LOOPBACK_EN, 1});
- if(res.error == CMD_OK)
+ FreeSRP::response res = _srp->send_cmd({FreeSRP::SET_LOOPBACK_EN, 1});
+ if(res.error == FreeSRP::CMD_OK)
{
- cout << "AD9364 in loopback mode" << endl;
+ std::cout << "AD9364 in loopback mode" << std::endl;
}
else
{
- throw runtime_error("Could not put AD9364 into loopback mode!");
+ throw std::runtime_error("Could not put AD9364 into loopback mode!");
}
}
else
{
- response res = _srp->send_cmd({SET_LOOPBACK_EN, 0});
- if(res.error != CMD_OK)
+ FreeSRP::response res = _srp->send_cmd({FreeSRP::SET_LOOPBACK_EN, 0});
+ if(res.error != FreeSRP::CMD_OK)
{
- throw runtime_error("Error disabling AD9364 loopback mode!");
+ throw std::runtime_error("Error disabling AD9364 loopback mode!");
}
}
@@ -104,28 +101,28 @@ freesrp_common::freesrp_common(const string &args)
_ignore_overflow = false;
}
}
- catch(const runtime_error& e)
+ catch(const std::runtime_error& e)
{
- cerr << "FreeSRP Error: " << e.what() << endl;
- throw runtime_error(e.what());
+ std::cerr << "FreeSRP Error: " << e.what() << std::endl;
+ throw std::runtime_error(e.what());
}
}
}
-vector<string> freesrp_common::get_devices()
+std::vector<std::string> freesrp_common::get_devices()
{
- vector<string> devices;
+ std::vector<std::string> devices;
- vector<string> serial_numbers = ::FreeSRP::FreeSRP::list_connected();
+ std::vector<std::string> serial_numbers = ::FreeSRP::FreeSRP::list_connected();
int index = 0;
- for(string &serial : serial_numbers)
+ for(std::string &serial : serial_numbers)
{
index++;
- string str;
- str = "freesrp=" + serial + ",label='FreeSRP " + to_string(index) + "'";
+ std::string str;
+ str = "freesrp=" + serial + ",label='FreeSRP " + std::to_string(index) + "'";
devices.push_back(str);
}
diff --git a/lib/freesrp/freesrp_common.h b/lib/freesrp/freesrp_common.h
index 9a5687c..8d13c47 100644
--- a/lib/freesrp/freesrp_common.h
+++ b/lib/freesrp/freesrp_common.h
@@ -1,6 +1,7 @@
#ifndef INCLUDED_FREESRP_COMMON_H
#define INCLUDED_FREESRP_COMMON_H
+#include <memory>
#include <vector>
#include <string>
@@ -22,7 +23,7 @@ public:
double set_freq_corr( double ppm, size_t chan = 0 );
double get_freq_corr( size_t chan = 0 );
protected:
- static boost::shared_ptr<::FreeSRP::FreeSRP> _srp;
+ static std::shared_ptr<::FreeSRP::FreeSRP> _srp;
bool _ignore_overflow = false;
};
diff --git a/lib/freesrp/freesrp_sink_c.cc b/lib/freesrp/freesrp_sink_c.cc
index fe692f4..8f121d7 100644
--- a/lib/freesrp/freesrp_sink_c.cc
+++ b/lib/freesrp/freesrp_sink_c.cc
@@ -1,9 +1,6 @@
#include "freesrp_sink_c.h"
-using namespace FreeSRP;
-using namespace std;
-
-freesrp_sink_c_sptr make_freesrp_sink_c (const string &args)
+freesrp_sink_c_sptr make_freesrp_sink_c (const std::string &args)
{
return gnuradio::get_initial_sptr(new freesrp_sink_c (args));
}
@@ -22,21 +19,21 @@ static const int MAX_IN = 1; // maximum number of input streams
static const int MIN_OUT = 0; // minimum number of output streams
static const int MAX_OUT = 0; // maximum number of output streams
-freesrp_sink_c::freesrp_sink_c (const string & args) : gr::sync_block("freesrp_sink_c",
+freesrp_sink_c::freesrp_sink_c (const std::string & args) : gr::sync_block("freesrp_sink_c",
gr::io_signature::make (MIN_IN, MAX_IN, sizeof (gr_complex)),
gr::io_signature::make (MIN_OUT, MAX_OUT, sizeof (gr_complex))),
freesrp_common(args)
{
if(_srp == nullptr)
{
- throw runtime_error("FreeSRP not initialized!");
+ throw std::runtime_error("FreeSRP not initialized!");
}
}
bool freesrp_sink_c::start()
{
- response res = _srp->send_cmd({SET_DATAPATH_EN, 1});
- if(res.error != CMD_OK)
+ FreeSRP::response res = _srp->send_cmd({FreeSRP::SET_DATAPATH_EN, 1});
+ if(res.error != FreeSRP::CMD_OK)
{
return false;
}
@@ -46,16 +43,16 @@ bool freesrp_sink_c::start()
bool freesrp_sink_c::stop()
{
- _srp->send_cmd({SET_DATAPATH_EN, 0});
+ _srp->send_cmd({FreeSRP::SET_DATAPATH_EN, 0});
_srp->stop_tx();
return true;
}
-void freesrp_sink_c::freesrp_tx_callback(vector<sample>& samples)
+void freesrp_sink_c::freesrp_tx_callback(std::vector<FreeSRP::sample>& samples)
{
- unique_lock<std::mutex> lk(_buf_mut);
+ std::unique_lock<std::mutex> lk(_buf_mut);
- for(sample &s : samples)
+ for(FreeSRP::sample &s : samples)
{
if(!_buf_queue.try_dequeue(s))
{
@@ -75,7 +72,7 @@ int freesrp_sink_c::work(int noutput_items, gr_vector_const_void_star& input_ite
{
const gr_complex *in = (const gr_complex *) input_items[0];
- unique_lock<std::mutex> lk(_buf_mut);
+ std::unique_lock<std::mutex> lk(_buf_mut);
// Wait until enough space is available
while(_buf_available_space < (unsigned int) noutput_items)
@@ -85,13 +82,13 @@ int freesrp_sink_c::work(int noutput_items, gr_vector_const_void_star& input_ite
for(int i = 0; i < noutput_items; ++i)
{
- sample s;
+ FreeSRP::sample s;
s.i = (int16_t) (real(in[i]) * 2047.0f);
s.q = (int16_t) (imag(in[i]) * 2047.0f);
if(!_buf_queue.try_enqueue(s))
{
- throw runtime_error("Failed to add sample to buffer. This should never happen. Available space reported to be " + to_string(_buf_available_space) + " samples, noutput_items=" + to_string(noutput_items) + ", i=" + to_string(i));
+ throw std::runtime_error("Failed to add sample to buffer. This should never happen. Available space reported to be " + std::to_string(_buf_available_space) + " samples, noutput_items=" + std::to_string(noutput_items) + ", i=" + std::to_string(i));
}
else
{
@@ -104,11 +101,11 @@ int freesrp_sink_c::work(int noutput_items, gr_vector_const_void_star& input_ite
double freesrp_sink_c::set_sample_rate( double rate )
{
- command cmd = _srp->make_command(SET_TX_SAMP_FREQ, rate);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_TX_SAMP_FREQ, rate);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set TX sample rate, error: " << r.error << endl;
+ std::cerr << "Could not set TX sample rate, error: " << r.error << std::endl;
return 0;
}
else
@@ -119,10 +116,10 @@ double freesrp_sink_c::set_sample_rate( double rate )
double freesrp_sink_c::get_sample_rate( void )
{
- response r = _srp->send_cmd({GET_TX_SAMP_FREQ, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_TX_SAMP_FREQ, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get TX sample rate, error: " << r.error << endl;
+ std::cerr << "Could not get TX sample rate, error: " << r.error << std::endl;
return 0;
}
else
@@ -133,11 +130,11 @@ double freesrp_sink_c::get_sample_rate( void )
double freesrp_sink_c::set_center_freq( double freq, size_t chan )
{
- command cmd = _srp->make_command(SET_TX_LO_FREQ, freq);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_TX_LO_FREQ, freq);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set TX LO frequency, error: " << r.error << endl;
+ std::cerr << "Could not set TX LO frequency, error: " << r.error << std::endl;
return 0;
}
else
@@ -148,10 +145,10 @@ double freesrp_sink_c::set_center_freq( double freq, size_t chan )
double freesrp_sink_c::get_center_freq( size_t chan )
{
- response r = _srp->send_cmd({GET_TX_LO_FREQ, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_TX_LO_FREQ, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get TX LO frequency, error: " << r.error << endl;
+ std::cerr << "Could not get TX LO frequency, error: " << r.error << std::endl;
return 0;
}
else
@@ -160,9 +157,9 @@ double freesrp_sink_c::get_center_freq( size_t chan )
}
}
-vector<string> freesrp_sink_c::get_gain_names( size_t chan )
+std::vector<std::string> freesrp_sink_c::get_gain_names( size_t chan )
{
- vector<string> names;
+ std::vector<std::string> names;
names.push_back("TX_RF");
@@ -178,7 +175,7 @@ osmosdr::gain_range_t freesrp_sink_c::get_gain_range(size_t chan)
return gain_ranges;
}
-osmosdr::gain_range_t freesrp_sink_c::get_gain_range(const string& name, size_t chan)
+osmosdr::gain_range_t freesrp_sink_c::get_gain_range(const std::string& name, size_t chan)
{
return get_gain_range(chan);
}
@@ -189,11 +186,11 @@ double freesrp_sink_c::set_gain(double gain, size_t chan)
double atten = 89.75 - gain;
- command cmd = _srp->make_command(SET_TX_ATTENUATION, atten * 1000);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_TX_ATTENUATION, atten * 1000);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set TX attenuation, error: " << r.error << endl;
+ std::cerr << "Could not set TX attenuation, error: " << r.error << std::endl;
return 0;
}
else
@@ -202,17 +199,17 @@ double freesrp_sink_c::set_gain(double gain, size_t chan)
}
}
-double freesrp_sink_c::set_gain(double gain, const string& name, size_t chan)
+double freesrp_sink_c::set_gain(double gain, const std::string& name, size_t chan)
{
return set_gain(gain, chan);
}
double freesrp_sink_c::get_gain(size_t chan)
{
- response r = _srp->send_cmd({GET_TX_ATTENUATION, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_TX_ATTENUATION, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get TX RF attenuation, error: " << r.error << endl;
+ std::cerr << "Could not get TX RF attenuation, error: " << r.error << std::endl;
return 0;
}
else
@@ -221,7 +218,7 @@ double freesrp_sink_c::get_gain(size_t chan)
}
}
-double freesrp_sink_c::get_gain(const string& name, size_t chan)
+double freesrp_sink_c::get_gain(const std::string& name, size_t chan)
{
return get_gain(chan);
}
@@ -231,32 +228,32 @@ double freesrp_sink_c::set_bb_gain(double gain, size_t chan)
return set_gain(gain, chan);
}
-vector<string> freesrp_sink_c::get_antennas(size_t chan)
+std::vector<std::string> freesrp_sink_c::get_antennas(size_t chan)
{
- vector<string> antennas;
+ std::vector<std::string> antennas;
antennas.push_back(get_antenna(chan));
return antennas;
}
-string freesrp_sink_c::set_antenna(const string& antenna, size_t chan)
+std::string freesrp_sink_c::set_antenna(const std::string& antenna, size_t chan)
{
return get_antenna(chan);
}
-string freesrp_sink_c::get_antenna(size_t chan)
+std::string freesrp_sink_c::get_antenna(size_t chan)
{
return "TX";
}
double freesrp_sink_c::set_bandwidth(double bandwidth, size_t chan)
{
- command cmd = _srp->make_command(SET_TX_RF_BANDWIDTH, bandwidth);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_TX_RF_BANDWIDTH, bandwidth);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set TX RF bandwidth, error: " << r.error << endl;
+ std::cerr << "Could not set TX RF bandwidth, error: " << r.error << std::endl;
return 0;
}
else
@@ -267,10 +264,10 @@ double freesrp_sink_c::set_bandwidth(double bandwidth, size_t chan)
double freesrp_sink_c::get_bandwidth(size_t chan)
{
- response r = _srp->send_cmd({GET_TX_RF_BANDWIDTH, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_TX_RF_BANDWIDTH, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get TX RF bandwidth, error: " << r.error << endl;
+ std::cerr << "Could not get TX RF bandwidth, error: " << r.error << std::endl;
return 0;
}
else
diff --git a/lib/freesrp/freesrp_sink_c.h b/lib/freesrp/freesrp_sink_c.h
index ce75785..23dd8ff 100644
--- a/lib/freesrp/freesrp_sink_c.h
+++ b/lib/freesrp/freesrp_sink_c.h
@@ -39,7 +39,7 @@
class freesrp_sink_c;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -47,9 +47,9 @@ class freesrp_sink_c;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<freesrp_sink_c> freesrp_sink_c_sptr;
+typedef std::shared_ptr<freesrp_sink_c> freesrp_sink_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of freesrp_sink_c.
diff --git a/lib/freesrp/freesrp_source_c.cc b/lib/freesrp/freesrp_source_c.cc
index 9c56780..5b9da06 100644
--- a/lib/freesrp/freesrp_source_c.cc
+++ b/lib/freesrp/freesrp_source_c.cc
@@ -1,9 +1,6 @@
#include "freesrp_source_c.h"
-using namespace FreeSRP;
-using namespace std;
-
-freesrp_source_c_sptr make_freesrp_source_c (const string &args)
+freesrp_source_c_sptr make_freesrp_source_c (const std::string &args)
{
return gnuradio::get_initial_sptr(new freesrp_source_c (args));
}
@@ -22,21 +19,21 @@ static const int MAX_IN = 0; // maximum number of input streams
static const int MIN_OUT = 1; // minimum number of output streams
static const int MAX_OUT = 1; // maximum number of output streams
-freesrp_source_c::freesrp_source_c (const string & args) : gr::sync_block ("freesrp_source_c",
+freesrp_source_c::freesrp_source_c (const std::string & args) : gr::sync_block ("freesrp_source_c",
gr::io_signature::make (MIN_IN, MAX_IN, sizeof (gr_complex)),
gr::io_signature::make (MIN_OUT, MAX_OUT, sizeof (gr_complex))),
freesrp_common(args)
{
if(_srp == nullptr)
{
- throw runtime_error("FreeSRP not initialized!");
+ throw std::runtime_error("FreeSRP not initialized!");
}
}
bool freesrp_source_c::start()
{
- response res = _srp->send_cmd({SET_DATAPATH_EN, 1});
- if(res.error != CMD_OK)
+ FreeSRP::response res = _srp->send_cmd({FreeSRP::SET_DATAPATH_EN, 1});
+ if(res.error != FreeSRP::CMD_OK)
{
return false;
}
@@ -49,7 +46,7 @@ bool freesrp_source_c::start()
bool freesrp_source_c::stop()
{
- _srp->send_cmd({SET_DATAPATH_EN, 0});
+ _srp->send_cmd({FreeSRP::SET_DATAPATH_EN, 0});
_srp->stop_rx();
_running = false;
@@ -57,17 +54,17 @@ bool freesrp_source_c::stop()
return true;
}
-void freesrp_source_c::freesrp_rx_callback(const vector<sample> &samples)
+void freesrp_source_c::freesrp_rx_callback(const std::vector<FreeSRP::sample> &samples)
{
- unique_lock<std::mutex> lk(_buf_mut);
+ std::unique_lock<std::mutex> lk(_buf_mut);
- for(const sample &s : samples)
+ for(const FreeSRP::sample &s : samples)
{
if(!_buf_queue.try_enqueue(s))
{
if(!_ignore_overflow)
{
- throw runtime_error("RX buffer overflow");
+ throw std::runtime_error("RX buffer overflow");
}
}
else
@@ -83,7 +80,7 @@ int freesrp_source_c::work(int noutput_items, gr_vector_const_void_star& input_i
{
gr_complex *out = static_cast<gr_complex *>(output_items[0]);
- unique_lock<std::mutex> lk(_buf_mut);
+ std::unique_lock<std::mutex> lk(_buf_mut);
if(!_running)
{
@@ -98,11 +95,11 @@ int freesrp_source_c::work(int noutput_items, gr_vector_const_void_star& input_i
for(int i = 0; i < noutput_items; ++i)
{
- sample s;
+ FreeSRP::sample s;
if(!_buf_queue.try_dequeue(s))
{
// This should not be happening
- throw runtime_error("Failed to get sample from buffer. This should never happen. Number of available samples reported to be " + to_string(_buf_num_samples) + ", noutput_items=" + to_string(noutput_items) + ", i=" + to_string(i));
+ throw std::runtime_error("Failed to get sample from buffer. This should never happen. Number of available samples reported to be " + std::to_string(_buf_num_samples) + ", noutput_items=" + std::to_string(noutput_items) + ", i=" + std::to_string(i));
}
else
{
@@ -117,11 +114,11 @@ int freesrp_source_c::work(int noutput_items, gr_vector_const_void_star& input_i
double freesrp_source_c::set_sample_rate( double rate )
{
- command cmd = _srp->make_command(SET_RX_SAMP_FREQ, rate);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_RX_SAMP_FREQ, rate);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set RX sample rate, error: " << r.error << endl;
+ std::cerr << "Could not set RX sample rate, error: " << r.error << std::endl;
return 0;
}
else
@@ -132,10 +129,10 @@ double freesrp_source_c::set_sample_rate( double rate )
double freesrp_source_c::get_sample_rate( void )
{
- response r = _srp->send_cmd({GET_RX_SAMP_FREQ, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_RX_SAMP_FREQ, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get RX sample rate, error: " << r.error << endl;
+ std::cerr << "Could not get RX sample rate, error: " << r.error << std::endl;
return 0;
}
else
@@ -146,11 +143,11 @@ double freesrp_source_c::get_sample_rate( void )
double freesrp_source_c::set_center_freq( double freq, size_t chan )
{
- command cmd = _srp->make_command(SET_RX_LO_FREQ, freq);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_RX_LO_FREQ, freq);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set RX LO frequency, error: " << r.error << endl;
+ std::cerr << "Could not set RX LO frequency, error: " << r.error << std::endl;
return 0;
}
else
@@ -161,10 +158,10 @@ double freesrp_source_c::set_center_freq( double freq, size_t chan )
double freesrp_source_c::get_center_freq( size_t chan )
{
- response r = _srp->send_cmd({GET_RX_LO_FREQ, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_RX_LO_FREQ, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get RX LO frequency, error: " << r.error << endl;
+ std::cerr << "Could not get RX LO frequency, error: " << r.error << std::endl;
return 0;
}
else
@@ -173,9 +170,9 @@ double freesrp_source_c::get_center_freq( size_t chan )
}
}
-vector<string> freesrp_source_c::get_gain_names( size_t chan )
+std::vector<std::string> freesrp_source_c::get_gain_names( size_t chan )
{
- vector<string> names;
+ std::vector<std::string> names;
names.push_back("RF");
@@ -193,41 +190,41 @@ osmosdr::gain_range_t freesrp_source_c::get_gain_range(size_t chan)
bool freesrp_source_c::set_gain_mode( bool automatic, size_t chan )
{
- uint8_t gc_mode = RF_GAIN_SLOWATTACK_AGC;
+ uint8_t gc_mode = FreeSRP::RF_GAIN_SLOWATTACK_AGC;
if(!automatic)
{
- gc_mode = RF_GAIN_MGC;
+ gc_mode = FreeSRP::RF_GAIN_MGC;
}
- command cmd = _srp->make_command(SET_RX_GC_MODE, gc_mode);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_RX_GC_MODE, gc_mode);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set RX RF gain control mode, error: " << r.error << endl;
+ std::cerr << "Could not set RX RF gain control mode, error: " << r.error << std::endl;
return false;
}
else
{
- return r.param != RF_GAIN_MGC;
+ return r.param != FreeSRP::RF_GAIN_MGC;
}
}
bool freesrp_source_c::get_gain_mode( size_t chan )
{
- response r = _srp->send_cmd({GET_RX_GC_MODE, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_RX_GC_MODE, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get RX RF gain control mode, error: " << r.error << endl;
+ std::cerr << "Could not get RX RF gain control mode, error: " << r.error << std::endl;
return false;
}
else
{
- return r.param != RF_GAIN_MGC;
+ return r.param != FreeSRP::RF_GAIN_MGC;
}
}
-osmosdr::gain_range_t freesrp_source_c::get_gain_range(const string& name, size_t chan)
+osmosdr::gain_range_t freesrp_source_c::get_gain_range(const std::string& name, size_t chan)
{
return get_gain_range(chan);
}
@@ -236,11 +233,11 @@ double freesrp_source_c::set_gain(double gain, size_t chan)
{
gain = get_gain_range().clip(gain);
- command cmd = _srp->make_command(SET_RX_RF_GAIN, gain);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_RX_RF_GAIN, gain);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set RX RF gain, error: " << r.error << endl;
+ std::cerr << "Could not set RX RF gain, error: " << r.error << std::endl;
return 0;
}
else
@@ -249,7 +246,7 @@ double freesrp_source_c::set_gain(double gain, size_t chan)
}
}
-double freesrp_source_c::set_gain(double gain, const string& name, size_t chan)
+double freesrp_source_c::set_gain(double gain, const std::string& name, size_t chan)
{
if(name == "RF")
{
@@ -263,10 +260,10 @@ double freesrp_source_c::set_gain(double gain, const string& name, size_t chan)
double freesrp_source_c::get_gain(size_t chan)
{
- response r = _srp->send_cmd({GET_RX_RF_GAIN, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_RX_RF_GAIN, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get RX RF gain, error: " << r.error << endl;
+ std::cerr << "Could not get RX RF gain, error: " << r.error << std::endl;
return 0;
}
else
@@ -275,7 +272,7 @@ double freesrp_source_c::get_gain(size_t chan)
}
}
-double freesrp_source_c::get_gain(const string& name, size_t chan)
+double freesrp_source_c::get_gain(const std::string& name, size_t chan)
{
if(name == "RF")
{
@@ -292,32 +289,32 @@ double freesrp_source_c::set_bb_gain(double gain, size_t chan)
return set_gain(gain, chan);
}
-vector<string> freesrp_source_c::get_antennas(size_t chan)
+std::vector<std::string> freesrp_source_c::get_antennas(size_t chan)
{
- vector<string> antennas;
+ std::vector<std::string> antennas;
antennas.push_back(get_antenna(chan));
return antennas;
}
-string freesrp_source_c::set_antenna(const string& antenna, size_t chan)
+std::string freesrp_source_c::set_antenna(const std::string& antenna, size_t chan)
{
return get_antenna(chan);
}
-string freesrp_source_c::get_antenna(size_t chan)
+std::string freesrp_source_c::get_antenna(size_t chan)
{
return "RX";
}
double freesrp_source_c::set_bandwidth(double bandwidth, size_t chan)
{
- command cmd = _srp->make_command(SET_RX_RF_BANDWIDTH, bandwidth);
- response r = _srp->send_cmd(cmd);
- if(r.error != CMD_OK)
+ FreeSRP::command cmd = _srp->make_command(FreeSRP::SET_RX_RF_BANDWIDTH, bandwidth);
+ FreeSRP::response r = _srp->send_cmd(cmd);
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not set RX RF bandwidth, error: " << r.error << endl;
+ std::cerr << "Could not set RX RF bandwidth, error: " << r.error << std::endl;
return 0;
}
else
@@ -328,10 +325,10 @@ double freesrp_source_c::set_bandwidth(double bandwidth, size_t chan)
double freesrp_source_c::get_bandwidth(size_t chan)
{
- response r = _srp->send_cmd({GET_RX_RF_BANDWIDTH, 0});
- if(r.error != CMD_OK)
+ FreeSRP::response r = _srp->send_cmd({FreeSRP::GET_RX_RF_BANDWIDTH, 0});
+ if(r.error != FreeSRP::CMD_OK)
{
- cerr << "Could not get RX RF bandwidth, error: " << r.error << endl;
+ std::cerr << "Could not get RX RF bandwidth, error: " << r.error << std::endl;
return 0;
}
else
diff --git a/lib/freesrp/freesrp_source_c.h b/lib/freesrp/freesrp_source_c.h
index 08f115c..6b1604c 100644
--- a/lib/freesrp/freesrp_source_c.h
+++ b/lib/freesrp/freesrp_source_c.h
@@ -40,7 +40,7 @@
class freesrp_source_c;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -48,9 +48,9 @@ class freesrp_source_c;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<freesrp_source_c> freesrp_source_c_sptr;
+typedef std::shared_ptr<freesrp_source_c> freesrp_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of freesrp_source_c.
diff --git a/lib/gnuradio-osmosdr.rc.in b/lib/gnuradio-osmosdr.rc.in
deleted file mode 100644
index 62fd5ea..0000000
--- a/lib/gnuradio-osmosdr.rc.in
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2013 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio 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, or (at your option)
- * any later version.
- *
- * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#include <afxres.h>
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@
- PRODUCTVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@
- FILEFLAGSMASK 0x3fL
-#ifndef NDEBUG
- FILEFLAGS 0x0L
-#else
- FILEFLAGS 0x1L
-#endif
- FILEOS VOS__WINDOWS32
- FILETYPE VFT_DLL
- FILESUBTYPE VFT2_DRV_INSTALLABLE
- BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "FileDescription", "gnuradio-osmosdr"
- VALUE "FileVersion", "@VERSION@"
- VALUE "InternalName", "gnuradio-osmosdr.dll"
- VALUE "LegalCopyright", "Licensed under GPLv3 or any later version"
- VALUE "OriginalFilename", "gnuradio-osmosdr.dll"
- VALUE "ProductName", "gnuradio-osmosdr"
- VALUE "ProductVersion", "@VERSION@"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
- END
diff --git a/lib/hackrf/CMakeLists.txt b/lib/hackrf/CMakeLists.txt
index c7af0c9..a0ec70a 100644
--- a/lib/hackrf/CMakeLists.txt
+++ b/lib/hackrf/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,27 +21,18 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${LIBHACKRF_INCLUDE_DIRS}
)
-set(hackrf_srcs
+APPEND_LIB_LIST(
+ ${LIBHACKRF_LIBRARIES}
+)
+
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/hackrf_common.cc
${CMAKE_CURRENT_SOURCE_DIR}/hackrf_source_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/hackrf_sink_c.cc
)
-
-INCLUDE(CheckFunctionExists)
-set(CMAKE_REQUIRED_LIBRARIES ${LIBHACKRF_LIBRARIES})
-CHECK_FUNCTION_EXISTS(hackrf_device_list LIBHACKRF_HAVE_DEVICE_LIST)
-
-if(LIBHACKRF_HAVE_DEVICE_LIST)
- message(STATUS "HackRF multiple device support enabled")
- add_definitions(-DLIBHACKRF_HAVE_DEVICE_LIST)
-endif(LIBHACKRF_HAVE_DEVICE_LIST)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${hackrf_srcs})
-list(APPEND gr_osmosdr_libs ${LIBHACKRF_LIBRARIES})
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/hackrf/hackrf_common.cc b/lib/hackrf/hackrf_common.cc
new file mode 100644
index 0000000..666dc60
--- /dev/null
+++ b/lib/hackrf/hackrf_common.cc
@@ -0,0 +1,427 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2020 Clayton Smith <argilo@gmail.com>
+ *
+ * gr-osmosdr 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, or (at your option)
+ * any later version.
+ *
+ * gr-osmosdr 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 gr-osmosdr; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "hackrf_common.h"
+
+#include "arg_helpers.h"
+
+int hackrf_common::_usage = 0;
+std::mutex hackrf_common::_usage_mutex;
+
+std::map<std::string, std::weak_ptr<hackrf_device>> hackrf_common::_devs;
+std::mutex hackrf_common::_devs_mutex;
+
+hackrf_common::hackrf_common(const std::string &args) :
+ _dev(NULL),
+ _sample_rate(0),
+ _center_freq(0),
+ _freq_corr(0),
+ _auto_gain(false),
+ _requested_bandwidth(0),
+ _bandwidth(0),
+ _bias(false),
+ _started(false)
+{
+ int ret;
+ hackrf_device *raw_dev;
+ hackrf_device_list_t *list;
+ int dev_index;
+ std::string target_serial = "0";
+ std::string final_serial = "";
+
+ dict_t dict = params_to_dict(args);
+ if (dict.count("hackrf") > 0 && dict["hackrf"].length() > 0) {
+ target_serial = dict["hackrf"];
+ }
+
+ {
+ std::lock_guard<std::mutex> guard(_usage_mutex);
+
+ if (_usage == 0) {
+ hackrf_init(); /* call only once before the first open */
+ }
+
+ _usage++;
+ }
+
+ list = hackrf_device_list();
+
+ if (target_serial.length() > 1) {
+ for (dev_index = 0; dev_index < list->devicecount; dev_index++) {
+ if (list->serial_numbers[dev_index]) {
+ std::string serial(list->serial_numbers[dev_index]);
+ if (serial.compare(serial.length() - target_serial.length(),
+ target_serial.length(), target_serial) == 0) {
+ break;
+ }
+ }
+ }
+
+ if (dev_index >= list->devicecount) {
+ hackrf_device_list_free(list);
+ throw std::runtime_error(
+ "No device found with serial number '" + target_serial + "'");
+ }
+ } else {
+ try {
+ dev_index = std::stoi(target_serial);
+ } catch (std::exception &ex) {
+ hackrf_device_list_free(list);
+ throw std::runtime_error(
+ "Failed to use '" + target_serial + "' as HackRF device index number");
+ }
+
+ if (dev_index >= list->devicecount) {
+ hackrf_device_list_free(list);
+ throw std::runtime_error(
+ "Failed to use '" + target_serial + "' as HackRF device index: not enough devices");
+ }
+ }
+
+ if (list->serial_numbers[dev_index]) {
+ final_serial = list->serial_numbers[dev_index];
+ }
+
+ {
+ std::lock_guard<std::mutex> guard(_devs_mutex);
+
+ if (_devs.count(final_serial) > 0 && !_devs[final_serial].expired()) {
+ _dev = hackrf_sptr(_devs[final_serial]);
+ } else {
+ ret = hackrf_device_list_open(list, dev_index, &raw_dev);
+ HACKRF_THROW_ON_ERROR(ret, "Failed to open HackRF device")
+ _dev = hackrf_sptr(raw_dev, hackrf_common::close);
+ _devs[final_serial] = static_cast<std::weak_ptr<struct hackrf_device>>(_dev);
+ }
+ }
+
+ hackrf_device_list_free(list);
+
+ uint8_t board_id;
+ ret = hackrf_board_id_read(_dev.get(), &board_id);
+ HACKRF_THROW_ON_ERROR(ret, "Failed to get HackRF board id")
+
+ char version[40];
+ memset(version, 0, sizeof(version));
+ ret = hackrf_version_string_read(_dev.get(), version, sizeof(version));
+ HACKRF_THROW_ON_ERROR(ret, "Failed to read version string")
+
+ std::cerr << "Using " << hackrf_board_id_name(hackrf_board_id(board_id)) << " "
+ << "with firmware " << version
+ << std::endl;
+}
+
+void hackrf_common::close(void *dev)
+{
+ int ret = hackrf_close(static_cast<hackrf_device *>(dev));
+ if (ret != HACKRF_SUCCESS)
+ {
+ std::cerr << HACKRF_FORMAT_ERROR(ret, "Failed to close HackRF") << std::endl;
+ }
+
+ {
+ std::lock_guard<std::mutex> guard(_usage_mutex);
+
+ _usage--;
+
+ if (_usage == 0) {
+ hackrf_exit(); /* call only once after last close */
+ }
+ }
+}
+
+std::vector<std::string> hackrf_common::get_devices()
+{
+ std::vector<std::string> devices;
+ std::string label;
+
+ {
+ std::lock_guard<std::mutex> guard(_usage_mutex);
+
+ if (_usage == 0) {
+ hackrf_init(); /* call only once before the first open */
+ }
+
+ _usage++;
+ }
+
+ hackrf_device_list_t *list = hackrf_device_list();
+
+ for (int i = 0; i < list->devicecount; i++) {
+ label = "HackRF ";
+ label += hackrf_usb_board_id_name(list->usb_board_ids[i]);
+
+ std::string args;
+ if (list->serial_numbers[i]) {
+ std::string serial(list->serial_numbers[i]);
+ if (serial.length() > 6)
+ serial = serial.substr(serial.length() - 6, 6);
+ args = "hackrf=" + serial;
+ if (serial.length() )
+ label += " " + serial;
+ } else {
+ args = "hackrf"; /* will pick the first one, serial number is required for choosing a specific one */
+ }
+
+ args += ",label='" + label + "'";
+ devices.push_back(args);
+ }
+
+ hackrf_device_list_free(list);
+
+ {
+ std::lock_guard<std::mutex> guard(_usage_mutex);
+
+ _usage--;
+
+ if (_usage == 0) {
+ hackrf_exit(); /* call only once after last close */
+ }
+ }
+
+ return devices;
+}
+
+osmosdr::meta_range_t hackrf_common::get_sample_rates()
+{
+ osmosdr::meta_range_t range;
+
+ /* we only add integer rates here because of better phase noise performance.
+ * the user is allowed to request arbitrary (fractional) rates within these
+ * boundaries. */
+
+ range.push_back(osmosdr::range_t( 8e6 ));
+ range.push_back(osmosdr::range_t( 10e6 ));
+ range.push_back(osmosdr::range_t( 12.5e6 ));
+ range.push_back(osmosdr::range_t( 16e6 ));
+ range.push_back(osmosdr::range_t( 20e6 )); /* confirmed to work on fast machines */
+
+ return range;
+}
+
+double hackrf_common::set_sample_rate( double rate )
+{
+ int ret;
+
+ if (_dev.get() && _started) {
+ ret = hackrf_set_sample_rate( _dev.get(), rate );
+ if ( HACKRF_SUCCESS != ret ) {
+ HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_sample_rate", rate ) )
+ }
+ }
+
+ _sample_rate = rate;
+ return get_sample_rate();
+}
+
+double hackrf_common::get_sample_rate()
+{
+ return _sample_rate;
+}
+
+osmosdr::freq_range_t hackrf_common::get_freq_range( size_t chan )
+{
+ osmosdr::freq_range_t range;
+
+ range.push_back(osmosdr::range_t( _sample_rate / 2, 7250e6 - _sample_rate / 2 ));
+
+ return range;
+}
+
+double hackrf_common::set_center_freq( double freq, size_t chan )
+{
+ int ret;
+
+ #define APPLY_PPM_CORR(val, ppm) ((val) * (1.0 + (ppm) * 0.000001))
+
+ if (_dev.get() && _started) {
+ double corr_freq = APPLY_PPM_CORR( freq, _freq_corr );
+ ret = hackrf_set_freq( _dev.get(), uint64_t(corr_freq) );
+ if ( HACKRF_SUCCESS != ret ) {
+ HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_freq", corr_freq ) )
+ }
+ }
+
+ _center_freq = freq;
+ return get_center_freq( chan );
+}
+
+double hackrf_common::get_center_freq( size_t chan )
+{
+ return _center_freq;
+}
+
+double hackrf_common::set_freq_corr( double ppm, size_t chan )
+{
+ _freq_corr = ppm;
+
+ set_center_freq( _center_freq );
+
+ return get_freq_corr( chan );
+}
+
+double hackrf_common::get_freq_corr( size_t chan )
+{
+ return _freq_corr;
+}
+
+bool hackrf_common::set_gain_mode( bool automatic, size_t chan )
+{
+ _auto_gain = automatic;
+
+ return get_gain_mode(chan);
+}
+
+bool hackrf_common::get_gain_mode( size_t chan )
+{
+ return _auto_gain;
+}
+
+double hackrf_common::set_gain( double gain, size_t chan )
+{
+ int ret;
+ double clip_gain = (gain >= 14.0) ? 14.0 : 0.0;
+
+ if (_dev.get() && _started) {
+ uint8_t value = (clip_gain == 14.0) ? 1 : 0;
+
+ ret = hackrf_set_amp_enable( _dev.get(), value );
+ if ( HACKRF_SUCCESS != ret ) {
+ HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_amp_enable", value ) )
+ }
+ }
+
+ _amp_gain = clip_gain;
+ return hackrf_common::get_gain(chan);
+}
+
+double hackrf_common::get_gain( size_t chan )
+{
+ return _amp_gain;
+}
+
+std::vector< std::string > hackrf_common::get_antennas( size_t chan )
+{
+ return { get_antenna( chan ) };
+}
+
+std::string hackrf_common::set_antenna( const std::string & antenna, size_t chan )
+{
+ return get_antenna( chan );
+}
+
+std::string hackrf_common::get_antenna( size_t chan )
+{
+ return "TX/RX";
+}
+
+double hackrf_common::set_bandwidth( double bandwidth, size_t chan )
+{
+ int ret;
+// osmosdr::freq_range_t bandwidths = get_bandwidth_range( chan );
+
+ _requested_bandwidth = bandwidth;
+ if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */
+ bandwidth = _sample_rate * 0.75; /* select narrower filters to prevent aliasing */
+
+ /* compute best default value depending on sample rate (auto filter) */
+ uint32_t bw = hackrf_compute_baseband_filter_bw( uint32_t(bandwidth) );
+
+ if (_dev.get() && _started) {
+ ret = hackrf_set_baseband_filter_bandwidth( _dev.get(), bw );
+ if (HACKRF_SUCCESS != ret) {
+ HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_baseband_filter_bandwidth", bw ) )
+ }
+ }
+
+ _bandwidth = bw;
+ return get_bandwidth(chan);
+}
+
+double hackrf_common::get_bandwidth( size_t chan )
+{
+ return _bandwidth;
+}
+
+osmosdr::freq_range_t hackrf_common::get_bandwidth_range( size_t chan )
+{
+ osmosdr::freq_range_t bandwidths;
+
+ // TODO: read out from libhackrf when an API is available
+
+ bandwidths.push_back(osmosdr::range_t( 1750000 ));
+ bandwidths.push_back(osmosdr::range_t( 2500000 ));
+ bandwidths.push_back(osmosdr::range_t( 3500000 ));
+ bandwidths.push_back(osmosdr::range_t( 5000000 ));
+ bandwidths.push_back(osmosdr::range_t( 5500000 ));
+ bandwidths.push_back(osmosdr::range_t( 6000000 ));
+ bandwidths.push_back(osmosdr::range_t( 7000000 ));
+ bandwidths.push_back(osmosdr::range_t( 8000000 ));
+ bandwidths.push_back(osmosdr::range_t( 9000000 ));
+ bandwidths.push_back(osmosdr::range_t( 10000000 ));
+ bandwidths.push_back(osmosdr::range_t( 12000000 ));
+ bandwidths.push_back(osmosdr::range_t( 14000000 ));
+ bandwidths.push_back(osmosdr::range_t( 15000000 ));
+ bandwidths.push_back(osmosdr::range_t( 20000000 ));
+ bandwidths.push_back(osmosdr::range_t( 24000000 ));
+ bandwidths.push_back(osmosdr::range_t( 28000000 ));
+
+ return bandwidths;
+}
+
+bool hackrf_common::set_bias( bool bias )
+{
+ int ret;
+
+ if (_dev.get() && _started) {
+ ret = hackrf_set_antenna_enable(_dev.get(), static_cast<uint8_t>(bias));
+ if (ret != HACKRF_SUCCESS)
+ {
+ std::cerr << "Failed to apply antenna bias voltage state: " << bias << HACKRF_FORMAT_ERROR(ret, "") << std::endl;
+ }
+ }
+
+ _bias = bias;
+ return get_bias();
+}
+
+bool hackrf_common::get_bias()
+{
+ return _bias;
+}
+
+void hackrf_common::start()
+{
+ _started = true;
+ set_center_freq(get_center_freq());
+ set_sample_rate(get_sample_rate());
+ if (_requested_bandwidth != 0)
+ set_bandwidth(get_bandwidth());
+ set_gain(get_gain());
+ set_bias(get_bias());
+}
+
+void hackrf_common::stop()
+{
+ _started = false;
+}
diff --git a/lib/hackrf/hackrf_common.h b/lib/hackrf/hackrf_common.h
new file mode 100644
index 0000000..d1ab47b
--- /dev/null
+++ b/lib/hackrf/hackrf_common.h
@@ -0,0 +1,113 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2020 Clayton Smith <argilo@gmail.com>
+ *
+ * gr-osmosdr 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, or (at your option)
+ * any later version.
+ *
+ * gr-osmosdr 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 gr-osmosdr; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifndef INCLUDED_HACKRF_COMMON_H
+#define INCLUDED_HACKRF_COMMON_H
+
+#include <map>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <vector>
+
+#include <boost/format.hpp>
+
+#include <osmosdr/ranges.h>
+#include <libhackrf/hackrf.h>
+
+#define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */
+#define BUF_NUM 15
+
+#define BYTES_PER_SAMPLE 2 /* HackRF device produces/consumes 8 bit signed IQ data */
+
+#define HACKRF_FORMAT_ERROR(ret, msg) \
+ boost::str( boost::format(msg " (%1%) %2%") \
+ % ret % hackrf_error_name((enum hackrf_error)ret) )
+
+#define HACKRF_THROW_ON_ERROR(ret, msg) \
+ if ( ret != HACKRF_SUCCESS ) \
+ { \
+ throw std::runtime_error( HACKRF_FORMAT_ERROR(ret, msg) ); \
+ }
+
+#define HACKRF_FUNC_STR(func, arg) \
+ boost::str(boost::format(func "(%1%)") % arg) + " has failed"
+
+typedef std::shared_ptr<hackrf_device> hackrf_sptr;
+
+class hackrf_common
+{
+public:
+ hackrf_common(const std::string &args);
+
+protected:
+ static std::vector< std::string > get_devices();
+
+ osmosdr::meta_range_t get_sample_rates( void );
+ double set_sample_rate( double rate );
+ double get_sample_rate( void );
+
+ osmosdr::freq_range_t get_freq_range( size_t chan = 0 );
+ double set_center_freq( double freq, size_t chan = 0 );
+ double get_center_freq( size_t chan = 0 );
+ double set_freq_corr( double ppm, size_t chan = 0 );
+ double get_freq_corr( size_t chan = 0 );
+
+ bool set_gain_mode( bool automatic, size_t chan = 0 );
+ bool get_gain_mode( size_t chan = 0 );
+ double set_gain( double gain, size_t chan = 0 );
+ double get_gain( size_t chan = 0 );
+
+ std::vector< std::string > get_antennas( size_t chan = 0 );
+ std::string set_antenna( const std::string & antenna, size_t chan = 0 );
+ std::string get_antenna( size_t chan = 0 );
+
+ double set_bandwidth( double bandwidth, size_t chan = 0 );
+ double get_bandwidth( size_t chan = 0 );
+ osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );
+
+ bool set_bias( bool bias );
+ bool get_bias();
+
+ void start();
+ void stop();
+
+ hackrf_sptr _dev;
+
+private:
+ static void close(void *dev);
+
+ static int _usage;
+ static std::mutex _usage_mutex;
+
+ static std::map<std::string, std::weak_ptr<hackrf_device>> _devs;
+ static std::mutex _devs_mutex;
+
+ double _sample_rate;
+ double _center_freq;
+ double _freq_corr;
+ bool _auto_gain;
+ double _amp_gain;
+ double _requested_bandwidth;
+ double _bandwidth;
+ bool _bias;
+ bool _started;
+};
+
+#endif /* INCLUDED_HACKRF_COMMON_H */
diff --git a/lib/hackrf/hackrf_sink_c.cc b/lib/hackrf/hackrf_sink_c.cc
index ee089c6..54ff3ef 100644
--- a/lib/hackrf/hackrf_sink_c.cc
+++ b/lib/hackrf/hackrf_sink_c.cc
@@ -2,19 +2,20 @@
/*
* Copyright 2013 Dimitri Stolnikov <horiz0n@gmx.net>
* Copyright 2014 Hoernchen <la@tfc-server.de>
+ * Copyright 2020 Clayton Smith <argilo@gmail.com>
*
- * GNU Radio is free software; you can redistribute it and/or modify
+ * gr-osmosdr 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, or (at your option)
* any later version.
*
- * GNU Radio is distributed in the hope that it will be useful,
+ * gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+ * along with gr-osmosdr; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
@@ -37,38 +38,12 @@
#include <emmintrin.h>
#endif
-#include <boost/assign.hpp>
-#include <boost/format.hpp>
-#include <boost/detail/endian.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/thread/thread.hpp>
-
#include <gnuradio/io_signature.h>
#include "hackrf_sink_c.h"
#include "arg_helpers.h"
-using namespace boost::assign;
-
-#define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */
-#define BUF_NUM 15
-
-#define BYTES_PER_SAMPLE 2 /* HackRF device consumes 8 bit unsigned IQ data */
-
-#define HACKRF_FORMAT_ERROR(ret, msg) \
- boost::str( boost::format(msg " (%1%) %2%") \
- % ret % hackrf_error_name((enum hackrf_error)ret) )
-
-#define HACKRF_THROW_ON_ERROR(ret, msg) \
- if ( ret != HACKRF_SUCCESS ) \
- { \
- throw std::runtime_error( HACKRF_FORMAT_ERROR(ret, msg) ); \
- }
-
-#define HACKRF_FUNC_STR(func, arg) \
- boost::str(boost::format(func "(%1%)") % arg) + " has failed"
-
static inline bool cb_init(circular_buffer_t *cb, size_t capacity, size_t sz)
{
cb->buffer = malloc(capacity * sz);
@@ -103,6 +78,11 @@ static inline bool cb_has_room(circular_buffer_t *cb)
return true;
}
+static inline bool cb_is_empty(circular_buffer_t *cb)
+{
+ return cb->count == 0;
+}
+
static inline bool cb_push_back(circular_buffer_t *cb, const void *item)
{
if(cb->count == cb->capacity)
@@ -127,9 +107,6 @@ static inline bool cb_pop_front(circular_buffer_t *cb, void *item)
return true;
}
-int hackrf_sink_c::_usage = 0;
-boost::mutex hackrf_sink_c::_usage_mutex;
-
hackrf_sink_c_sptr make_hackrf_sink_c (const std::string & args)
{
return gnuradio::get_initial_sptr(new hackrf_sink_c (args));
@@ -156,66 +133,21 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
: gr::sync_block ("hackrf_sink_c",
gr::io_signature::make(MIN_IN, MAX_IN, sizeof (gr_complex)),
gr::io_signature::make(MIN_OUT, MAX_OUT, sizeof (gr_complex))),
- _dev(NULL),
+ hackrf_common::hackrf_common(args),
_buf(NULL),
- _sample_rate(0),
- _center_freq(0),
- _freq_corr(0),
- _auto_gain(false),
- _amp_gain(0),
- _vga_gain(0),
- _bandwidth(0)
+ _vga_gain(0)
{
- int ret;
- std::string *hackrf_serial = NULL;
-
dict_t dict = params_to_dict(args);
- if (dict.count("hackrf") && dict["hackrf"].length() > 0)
- hackrf_serial = &dict["hackrf"];
-
_buf_num = 0;
if (dict.count("buffers"))
- _buf_num = boost::lexical_cast< unsigned int >( dict["buffers"] );
+ _buf_num = std::stoi(dict["buffers"]);
if (0 == _buf_num)
_buf_num = BUF_NUM;
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- if ( _usage == 0 )
- hackrf_init(); /* call only once before the first open */
-
- _usage++;
- }
-
- _dev = NULL;
-#ifdef LIBHACKRF_HAVE_DEVICE_LIST
- if ( hackrf_serial )
- ret = hackrf_open_by_serial( hackrf_serial->c_str(), &_dev );
- else
-#endif
- ret = hackrf_open( &_dev );
- HACKRF_THROW_ON_ERROR(ret, "Failed to open HackRF device")
-
- uint8_t board_id;
- ret = hackrf_board_id_read( _dev, &board_id );
- HACKRF_THROW_ON_ERROR(ret, "Failed to get HackRF board id")
-
- char version[40];
- memset(version, 0, sizeof(version));
- ret = hackrf_version_string_read( _dev, version, sizeof(version));
- HACKRF_THROW_ON_ERROR(ret, "Failed to read version string")
-#if 0
- read_partid_serialno_t serial_number;
- ret = hackrf_board_partid_serialno_read( _dev, &serial_number );
- HACKRF_THROW_ON_ERROR(ret, "Failed to read serial number")
-#endif
- std::cerr << "Using " << hackrf_board_id_name(hackrf_board_id(board_id)) << " "
- << "with firmware " << version << " "
- << std::endl;
+ _stopping = false;
if ( BUF_NUM != _buf_num ) {
std::cerr << "Using " << _buf_num << " buffers of size " << BUF_LEN << "."
@@ -232,26 +164,12 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
// Check device args to find out if bias/phantom power is desired.
if ( dict.count("bias_tx") ) {
- bool bias = boost::lexical_cast<bool>( dict["bias_tx"] );
- ret = hackrf_set_antenna_enable(_dev, static_cast<uint8_t>(bias));
- if ( ret != HACKRF_SUCCESS )
- {
- std::cerr << "Failed to apply antenna bias voltage state: " << bias << HACKRF_FORMAT_ERROR(ret, "") << std::endl;
- }
- else
- {
- std::cerr << (bias ? "Enabled" : "Disabled") << " antenna bias voltage" << std::endl;
- }
+ hackrf_common::set_bias(dict["bias_tx"] == "1");
}
_buf = (int8_t *) malloc( BUF_LEN );
cb_init( &_cbuf, _buf_num, BUF_LEN );
-
-// _thread = gr::thread::thread(_hackrf_wait, this);
-
- ret = hackrf_start_tx( _dev, _hackrf_tx_callback, (void *)this );
- HACKRF_THROW_ON_ERROR(ret, "Failed to start TX streaming")
}
/*
@@ -259,30 +177,6 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
*/
hackrf_sink_c::~hackrf_sink_c ()
{
- if (_dev) {
-// _thread.join();
- int ret = hackrf_stop_tx( _dev );
- if ( ret != HACKRF_SUCCESS )
- {
- std::cerr << HACKRF_FORMAT_ERROR(ret, "Failed to stop TX streaming") << std::endl;
- }
- ret = hackrf_close( _dev );
- if ( ret != HACKRF_SUCCESS )
- {
- std::cerr << HACKRF_FORMAT_ERROR(ret, "Failed to close HackRF") << std::endl;
- }
- _dev = NULL;
-
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- _usage--;
-
- if ( _usage == 0 )
- hackrf_exit(); /* call only once after last close */
- }
- }
-
free(_buf);
_buf = NULL;
@@ -302,11 +196,16 @@ int hackrf_sink_c::hackrf_tx_callback(unsigned char *buffer, uint32_t length)
*buffer++ = rand() % 255;
#else
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock(_buf_mutex);
if ( ! cb_pop_front( &_cbuf, buffer ) ) {
memset(buffer, 0, length);
- std::cerr << "U" << std::flush;
+ if (_stopping) {
+ _buf_cond.notify_one();
+ return -1;
+ } else {
+ std::cerr << "U" << std::flush;
+ }
} else {
// std::cerr << "-" << std::flush;
_buf_cond.notify_one();
@@ -316,42 +215,61 @@ int hackrf_sink_c::hackrf_tx_callback(unsigned char *buffer, uint32_t length)
return 0; // TODO: return -1 on error/stop
}
-void hackrf_sink_c::_hackrf_wait(hackrf_sink_c *obj)
-{
- obj->hackrf_wait();
-}
-
-void hackrf_sink_c::hackrf_wait()
-{
-}
-
bool hackrf_sink_c::start()
{
- if ( ! _dev )
+ if ( ! _dev.get() )
return false;
+ _stopping = false;
_buf_used = 0;
-#if 0
- int ret = hackrf_start_tx( _dev, _hackrf_tx_callback, (void *)this );
+ hackrf_common::start();
+ int ret = hackrf_start_tx( _dev.get(), _hackrf_tx_callback, (void *)this );
if ( ret != HACKRF_SUCCESS ) {
std::cerr << "Failed to start TX streaming (" << ret << ")" << std::endl;
return false;
}
-#endif
return true;
}
bool hackrf_sink_c::stop()
{
- if ( ! _dev )
+ int i;
+
+ if ( ! _dev.get() )
return false;
-#if 0
- int ret = hackrf_stop_tx( _dev );
+
+ {
+ std::unique_lock<std::mutex> lock(_buf_mutex);
+
+ while ( ! cb_has_room(&_cbuf) )
+ _buf_cond.wait( lock );
+
+ // Fill the rest of the current buffer with silence.
+ memset(_buf + _buf_used, 0, BUF_LEN - _buf_used);
+ cb_push_back( &_cbuf, _buf );
+ _buf_used = 0;
+
+ // Add some more silence so the end doesn't get cut off.
+ memset(_buf, 0, BUF_LEN);
+ for (i = 0; i < 5; i++) {
+ while ( ! cb_has_room(&_cbuf) )
+ _buf_cond.wait( lock );
+
+ cb_push_back( &_cbuf, _buf );
+ }
+
+ _stopping = true;
+
+ while (hackrf_is_streaming(_dev.get()) == HACKRF_TRUE)
+ _buf_cond.wait( lock );
+ }
+
+ hackrf_common::stop();
+ int ret = hackrf_stop_tx( _dev.get() );
if ( ret != HACKRF_SUCCESS ) {
std::cerr << "Failed to stop TX streaming (" << ret << ")" << std::endl;
return false;
}
-#endif
return true;
}
@@ -381,7 +299,7 @@ void convert_avx(const float* inbuf, int8_t* outbuf,const unsigned int count)
#elif USE_SSE2
void convert_sse2(const float* inbuf, int8_t* outbuf,const unsigned int count)
{
- const register __m128 mulme = _mm_set_ps( 127.0f, 127.0f, 127.0f, 127.0f );
+ const __m128 mulme = _mm_set_ps( 127.0f, 127.0f, 127.0f, 127.0f );
__m128 itmp1,itmp2,itmp3,itmp4;
__m128i otmp1,otmp2,otmp3,otmp4;
@@ -424,7 +342,7 @@ int hackrf_sink_c::work( int noutput_items,
const gr_complex *in = (const gr_complex *) input_items[0];
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::unique_lock<std::mutex> lock(_buf_mutex);
while ( ! cb_has_room(&_cbuf) )
_buf_cond.wait( lock );
@@ -454,7 +372,7 @@ int hackrf_sink_c::work( int noutput_items,
if((unsigned int)noutput_items >= remaining) {
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock(_buf_mutex);
if ( ! cb_push_back( &_cbuf, _buf ) ) {
_buf_used = prev_buf_used;
@@ -477,78 +395,7 @@ int hackrf_sink_c::work( int noutput_items,
std::vector<std::string> hackrf_sink_c::get_devices()
{
- std::vector<std::string> devices;
- std::string label;
-
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- if ( _usage == 0 )
- hackrf_init(); /* call only once before the first open */
-
- _usage++;
- }
-
-#ifdef LIBHACKRF_HAVE_DEVICE_LIST
- hackrf_device_list_t *list = hackrf_device_list();
-
- for (int i = 0; i < list->devicecount; i++) {
- label = "HackRF ";
- label += hackrf_usb_board_id_name( list->usb_board_ids[i] );
-
- std::string args;
- if (list->serial_numbers[i]) {
- std::string serial = boost::lexical_cast< std::string >( list->serial_numbers[i] );
- if (serial.length() > 6)
- serial = serial.substr(serial.length() - 6, 6);
- args = "hackrf=" + serial;
- label += " " + serial;
- } else
- args = "hackrf"; /* will pick the first one, serial number is required for choosing a specific one */
-
- boost::algorithm::trim(label);
-
- args += ",label='" + label + "'";
- devices.push_back( args );
- }
-
- hackrf_device_list_free(list);
-#else
-
- int ret;
- hackrf_device *dev = NULL;
- ret = hackrf_open(&dev);
- if ( HACKRF_SUCCESS == ret )
- {
- std::string args = "hackrf=0";
-
- label = "HackRF";
-
- uint8_t board_id;
- ret = hackrf_board_id_read( dev, &board_id );
- if ( HACKRF_SUCCESS == ret )
- {
- label += std::string(" ") + hackrf_board_id_name(hackrf_board_id(board_id));
- }
-
- args += ",label='" + label + "'";
- devices.push_back( args );
-
- ret = hackrf_close(dev);
- }
-
-#endif
-
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- _usage--;
-
- if ( _usage == 0 )
- hackrf_exit(); /* call only once after last close */
- }
-
- return devices;
+ return hackrf_common::get_devices();
}
size_t hackrf_sink_c::get_num_channels()
@@ -558,98 +405,47 @@ size_t hackrf_sink_c::get_num_channels()
osmosdr::meta_range_t hackrf_sink_c::get_sample_rates()
{
- osmosdr::meta_range_t range;
-
- /* we only add integer rates here because of better phase noise performance.
- * the user is allowed to request arbitrary (fractional) rates within these
- * boundaries. */
-
- range += osmosdr::range_t( 8e6 );
- range += osmosdr::range_t( 10e6 );
- range += osmosdr::range_t( 12.5e6 );
- range += osmosdr::range_t( 16e6 );
- range += osmosdr::range_t( 20e6 ); /* confirmed to work on fast machines */
-
- return range;
+ return hackrf_common::get_sample_rates();
}
double hackrf_sink_c::set_sample_rate( double rate )
{
- int ret;
-
- if (_dev) {
- ret = hackrf_set_sample_rate( _dev, rate );
- if ( HACKRF_SUCCESS == ret ) {
- _sample_rate = rate;
- //set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_sample_rate", rate ) )
- }
- }
-
- return get_sample_rate();
+ return hackrf_common::set_sample_rate(rate);
}
double hackrf_sink_c::get_sample_rate()
{
- return _sample_rate;
+ return hackrf_common::get_sample_rate();
}
osmosdr::freq_range_t hackrf_sink_c::get_freq_range( size_t chan )
{
- osmosdr::freq_range_t range;
-
- range += osmosdr::range_t( _sample_rate / 2, 7250e6 - _sample_rate / 2 );
-
- return range;
+ return hackrf_common::get_freq_range(chan);
}
double hackrf_sink_c::set_center_freq( double freq, size_t chan )
{
- int ret;
-
- #define APPLY_PPM_CORR(val, ppm) ((val) * (1.0 + (ppm) * 0.000001))
-
- if (_dev) {
- double corr_freq = APPLY_PPM_CORR( freq, _freq_corr );
- ret = hackrf_set_freq( _dev, uint64_t(corr_freq) );
- if ( HACKRF_SUCCESS == ret ) {
- _center_freq = freq;
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_freq", corr_freq ) )
- }
- }
-
- return get_center_freq( chan );
+ return hackrf_common::set_center_freq(freq, chan);
}
double hackrf_sink_c::get_center_freq( size_t chan )
{
- return _center_freq;
+ return hackrf_common::get_center_freq(chan);
}
double hackrf_sink_c::set_freq_corr( double ppm, size_t chan )
{
- _freq_corr = ppm;
-
- set_center_freq( _center_freq );
-
- return get_freq_corr( chan );
+ return hackrf_common::set_freq_corr(ppm, chan);
}
double hackrf_sink_c::get_freq_corr( size_t chan )
{
- return _freq_corr;
+ return hackrf_common::get_freq_corr(chan);
}
std::vector<std::string> hackrf_sink_c::get_gain_names( size_t chan )
{
- std::vector< std::string > names;
-
- names += "RF";
- names += "IF";
-
- return names;
+ return { "RF", "IF" };
}
osmosdr::gain_range_t hackrf_sink_c::get_gain_range( size_t chan )
@@ -672,34 +468,17 @@ osmosdr::gain_range_t hackrf_sink_c::get_gain_range( const std::string & name, s
bool hackrf_sink_c::set_gain_mode( bool automatic, size_t chan )
{
- _auto_gain = automatic;
-
- return get_gain_mode(chan);
+ return hackrf_common::set_gain_mode(automatic, chan);
}
bool hackrf_sink_c::get_gain_mode( size_t chan )
{
- return _auto_gain;
+ return hackrf_common::get_gain_mode(chan);
}
double hackrf_sink_c::set_gain( double gain, size_t chan )
{
- int ret;
- osmosdr::gain_range_t rf_gains = get_gain_range( "RF", chan );
-
- if (_dev) {
- double clip_gain = rf_gains.clip( gain, true );
- uint8_t value = clip_gain == 14.0f ? 1 : 0;
-
- ret = hackrf_set_amp_enable( _dev, value );
- if ( HACKRF_SUCCESS == ret ) {
- _amp_gain = clip_gain;
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_amp_enable", value ) )
- }
- }
-
- return _amp_gain;
+ return hackrf_common::set_gain(gain, chan);
}
double hackrf_sink_c::set_gain( double gain, const std::string & name, size_t chan)
@@ -717,7 +496,7 @@ double hackrf_sink_c::set_gain( double gain, const std::string & name, size_t ch
double hackrf_sink_c::get_gain( size_t chan )
{
- return _amp_gain;
+ return hackrf_common::get_gain(chan);
}
double hackrf_sink_c::get_gain( const std::string & name, size_t chan )
@@ -738,10 +517,10 @@ double hackrf_sink_c::set_if_gain( double gain, size_t chan )
int ret;
osmosdr::gain_range_t if_gains = get_gain_range( "IF", chan );
- if (_dev) {
+ if (_dev.get()) {
double clip_gain = if_gains.clip( gain, true );
- ret = hackrf_set_txvga_gain( _dev, uint32_t(clip_gain) );
+ ret = hackrf_set_txvga_gain( _dev.get(), uint32_t(clip_gain) );
if ( HACKRF_SUCCESS == ret ) {
_vga_gain = clip_gain;
} else {
@@ -759,72 +538,30 @@ double hackrf_sink_c::set_bb_gain( double gain, size_t chan )
std::vector< std::string > hackrf_sink_c::get_antennas( size_t chan )
{
- std::vector< std::string > antennas;
-
- antennas += get_antenna( chan );
-
- return antennas;
+ return hackrf_common::get_antennas(chan);
}
std::string hackrf_sink_c::set_antenna( const std::string & antenna, size_t chan )
{
- return get_antenna( chan );
+ return hackrf_common::set_antenna(antenna, chan);
}
std::string hackrf_sink_c::get_antenna( size_t chan )
{
- return "TX/RX";
+ return hackrf_common::get_antenna(chan);
}
double hackrf_sink_c::set_bandwidth( double bandwidth, size_t chan )
{
- int ret;
-// osmosdr::freq_range_t bandwidths = get_bandwidth_range( chan );
-
- if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */
- bandwidth = _sample_rate * 0.75; /* select narrower filters to prevent aliasing */
-
- if ( _dev ) {
- /* compute best default value depending on sample rate (auto filter) */
- uint32_t bw = hackrf_compute_baseband_filter_bw( uint32_t(bandwidth) );
- ret = hackrf_set_baseband_filter_bandwidth( _dev, bw );
- if ( HACKRF_SUCCESS == ret ) {
- _bandwidth = bw;
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_baseband_filter_bandwidth", bw ) )
- }
- }
-
- return _bandwidth;
+ return hackrf_common::set_bandwidth(bandwidth, chan);
}
double hackrf_sink_c::get_bandwidth( size_t chan )
{
- return _bandwidth;
+ return hackrf_common::get_bandwidth(chan);
}
osmosdr::freq_range_t hackrf_sink_c::get_bandwidth_range( size_t chan )
{
- osmosdr::freq_range_t bandwidths;
-
- // TODO: read out from libhackrf when an API is available
-
- bandwidths += osmosdr::range_t( 1750000 );
- bandwidths += osmosdr::range_t( 2500000 );
- bandwidths += osmosdr::range_t( 3500000 );
- bandwidths += osmosdr::range_t( 5000000 );
- bandwidths += osmosdr::range_t( 5500000 );
- bandwidths += osmosdr::range_t( 6000000 );
- bandwidths += osmosdr::range_t( 7000000 );
- bandwidths += osmosdr::range_t( 8000000 );
- bandwidths += osmosdr::range_t( 9000000 );
- bandwidths += osmosdr::range_t( 10000000 );
- bandwidths += osmosdr::range_t( 12000000 );
- bandwidths += osmosdr::range_t( 14000000 );
- bandwidths += osmosdr::range_t( 15000000 );
- bandwidths += osmosdr::range_t( 20000000 );
- bandwidths += osmosdr::range_t( 24000000 );
- bandwidths += osmosdr::range_t( 28000000 );
-
- return bandwidths;
+ return hackrf_common::get_bandwidth_range(chan);
}
diff --git a/lib/hackrf/hackrf_sink_c.h b/lib/hackrf/hackrf_sink_c.h
index a7e7ab8..ef719f3 100644
--- a/lib/hackrf/hackrf_sink_c.h
+++ b/lib/hackrf/hackrf_sink_c.h
@@ -1,34 +1,35 @@
/* -*- c++ -*- */
/*
* Copyright 2013 Dimitri Stolnikov <horiz0n@gmx.net>
+ * Copyright 2020 Clayton Smith <argilo@gmail.com>
*
- * GNU Radio is free software; you can redistribute it and/or modify
+ * gr-osmosdr 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, or (at your option)
* any later version.
*
- * GNU Radio is distributed in the hope that it will be useful,
+ * gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+ * along with gr-osmosdr; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_HACKRF_SINK_C_H
#define INCLUDED_HACKRF_SINK_C_H
-#include <gnuradio/thread/thread.h>
#include <gnuradio/sync_block.h>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+#include <condition_variable>
+#include <mutex>
#include <libhackrf/hackrf.h>
#include "sink_iface.h"
+#include "hackrf_common.h"
class hackrf_sink_c;
@@ -44,7 +45,7 @@ typedef struct circular_buffer
} circular_buffer_t;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr::blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -52,9 +53,9 @@ typedef struct circular_buffer
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<hackrf_sink_c> hackrf_sink_c_sptr;
+typedef std::shared_ptr<hackrf_sink_c> hackrf_sink_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of hackrf_sink_c.
@@ -67,7 +68,8 @@ hackrf_sink_c_sptr make_hackrf_sink_c (const std::string & args = "");
class hackrf_sink_c :
public gr::sync_block,
- public sink_iface
+ public sink_iface,
+ protected hackrf_common
{
private:
// The friend declaration allows hackrf_make_sink_c to
@@ -124,29 +126,16 @@ public:
private:
static int _hackrf_tx_callback(hackrf_transfer* transfer);
int hackrf_tx_callback(unsigned char *buffer, uint32_t length);
- static void _hackrf_wait(hackrf_sink_c *obj);
- void hackrf_wait();
-
- static int _usage;
- static boost::mutex _usage_mutex;
-
- hackrf_device *_dev;
-// gr::thread::thread _thread;
circular_buffer_t _cbuf;
int8_t *_buf;
unsigned int _buf_num;
unsigned int _buf_used;
- boost::mutex _buf_mutex;
- boost::condition_variable _buf_cond;
-
- double _sample_rate;
- double _center_freq;
- double _freq_corr;
- bool _auto_gain;
- double _amp_gain;
+ bool _stopping;
+ std::mutex _buf_mutex;
+ std::condition_variable _buf_cond;
+
double _vga_gain;
- double _bandwidth;
};
#endif /* INCLUDED_HACKRF_SINK_C_H */
diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc
index 30b63c7..03ea3bd 100644
--- a/lib/hackrf/hackrf_source_c.cc
+++ b/lib/hackrf/hackrf_source_c.cc
@@ -1,19 +1,20 @@
/* -*- c++ -*- */
/*
* Copyright 2013 Dimitri Stolnikov <horiz0n@gmx.net>
+ * Copyright 2020 Clayton Smith <argilo@gmail.com>
*
- * GNU Radio is free software; you can redistribute it and/or modify
+ * gr-osmosdr 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, or (at your option)
* any later version.
*
- * GNU Radio is distributed in the hope that it will be useful,
+ * gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+ * along with gr-osmosdr; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
@@ -29,12 +30,7 @@
#include <stdexcept>
#include <iostream>
-
-#include <boost/assign.hpp>
-#include <boost/format.hpp>
-#include <boost/detail/endian.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/thread/thread.hpp>
+#include <chrono>
#include <gnuradio/io_signature.h>
@@ -42,29 +38,6 @@
#include "arg_helpers.h"
-using namespace boost::assign;
-
-#define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */
-#define BUF_NUM 15
-
-#define BYTES_PER_SAMPLE 2 /* HackRF device produces 8 bit unsigned IQ data */
-
-#define HACKRF_FORMAT_ERROR(ret, msg) \
- boost::str( boost::format(msg " (%1%) %2%") \
- % ret % hackrf_error_name((enum hackrf_error)ret) )
-
-#define HACKRF_THROW_ON_ERROR(ret, msg) \
- if ( ret != HACKRF_SUCCESS ) \
- { \
- throw std::runtime_error( HACKRF_FORMAT_ERROR(ret, msg) ); \
- }
-
-#define HACKRF_FUNC_STR(func, arg) \
- boost::str(boost::format(func "(%1%)") % arg) + " has failed"
-
-int hackrf_source_c::_usage = 0;
-boost::mutex hackrf_source_c::_usage_mutex;
-
hackrf_source_c_sptr make_hackrf_source_c (const std::string & args)
{
return gnuradio::get_initial_sptr(new hackrf_source_c (args));
@@ -91,29 +64,20 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
: gr::sync_block ("hackrf_source_c",
gr::io_signature::make(MIN_IN, MAX_IN, sizeof (gr_complex)),
gr::io_signature::make(MIN_OUT, MAX_OUT, sizeof (gr_complex))),
- _dev(NULL),
+ hackrf_common::hackrf_common(args),
_buf(NULL),
- _sample_rate(0),
- _center_freq(0),
- _freq_corr(0),
- _auto_gain(false),
- _amp_gain(0),
_lna_gain(0),
- _vga_gain(0),
- _bandwidth(0)
+ _vga_gain(0)
{
- int ret;
- std::string hackrf_serial;
-
dict_t dict = params_to_dict(args);
_buf_num = _buf_len = _buf_head = _buf_used = _buf_offset = 0;
if (dict.count("buffers"))
- _buf_num = boost::lexical_cast< unsigned int >( dict["buffers"] );
+ _buf_num = std::stoi(dict["buffers"]);
// if (dict.count("buflen"))
-// _buf_len = boost::lexical_cast< unsigned int >( dict["buflen"] );
+// _buf_len = std::stoi(dict["buflen"]);
if (0 == _buf_num)
_buf_num = BUF_NUM;
@@ -124,76 +88,10 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
_samp_avail = _buf_len / BYTES_PER_SAMPLE;
// create a lookup table for gr_complex values
- for (unsigned int i = 0; i <= 0xffff; i++) {
-#ifdef BOOST_LITTLE_ENDIAN
- _lut.push_back( gr_complex( (float(int8_t(i & 0xff))) * (1.0f/128.0f),
- (float(int8_t(i >> 8))) * (1.0f/128.0f) ) );
-#else // BOOST_BIG_ENDIAN
- _lut.push_back( gr_complex( (float(int8_t(i >> 8))) * (1.0f/128.0f),
- (float(int8_t(i & 0xff))) * (1.0f/128.0f) ) );
-#endif
- }
-
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- if ( _usage == 0 )
- hackrf_init(); /* call only once before the first open */
-
- _usage++;
+ for (unsigned int i = 0; i <= 0xff; i++) {
+ _lut.push_back( float(int8_t(i)) * (1.0f/128.0f) );
}
- _dev = NULL;
-
-#ifdef LIBHACKRF_HAVE_DEVICE_LIST
- if (dict.count("hackrf") && dict["hackrf"].length() > 0) {
- hackrf_serial = dict["hackrf"];
-
- if (hackrf_serial.length() > 1) {
- ret = hackrf_open_by_serial( hackrf_serial.c_str(), &_dev );
- } else {
- int dev_index = 0;
- try {
- dev_index = boost::lexical_cast< int >( hackrf_serial );
- } catch ( std::exception &ex ) {
- throw std::runtime_error(
- "Failed to use '" + hackrf_serial + "' as HackRF device index number: " + ex.what());
- }
-
- hackrf_device_list_t *list = hackrf_device_list();
- if (dev_index < list->devicecount) {
- ret = hackrf_device_list_open(list, dev_index, &_dev);
- } else {
- hackrf_device_list_free(list);
- throw std::runtime_error(
- "Failed to use '" + hackrf_serial + "' as HackRF device index: not enough devices");
- }
- hackrf_device_list_free(list);
- }
- } else
-#endif
- ret = hackrf_open( &_dev );
-
- HACKRF_THROW_ON_ERROR(ret, "Failed to open HackRF device")
-
- uint8_t board_id;
- ret = hackrf_board_id_read( _dev, &board_id );
- HACKRF_THROW_ON_ERROR(ret, "Failed to get HackRF board id")
-
- char version[40];
- memset(version, 0, sizeof(version));
- ret = hackrf_version_string_read( _dev, version, sizeof(version));
- HACKRF_THROW_ON_ERROR(ret, "Failed to read version string")
-
-#if 0
- read_partid_serialno_t serial_number;
- ret = hackrf_board_partid_serialno_read( _dev, &serial_number );
- HACKRF_THROW_ON_ERROR(ret, "Failed to read serial number")
-#endif
- std::cerr << "Using " << hackrf_board_id_name(hackrf_board_id(board_id)) << " "
- << "with firmware " << version << " "
- << std::endl;
-
if ( BUF_NUM != _buf_num || BUF_LEN != _buf_len ) {
std::cerr << "Using " << _buf_num << " buffers of size " << _buf_len << "."
<< std::endl;
@@ -211,29 +109,15 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
// Check device args to find out if bias/phantom power is desired.
if ( dict.count("bias") ) {
- bool bias = boost::lexical_cast<bool>( dict["bias"] );
- ret = hackrf_set_antenna_enable(_dev, static_cast<uint8_t>(bias));
- if ( ret != HACKRF_SUCCESS )
- {
- std::cerr << "Failed to apply antenna bias voltage state: " << bias << HACKRF_FORMAT_ERROR(ret, "") << std::endl;
- }
- else
- {
- std::cerr << (bias ? "Enabled" : "Disabled") << " antenna bias voltage" << std::endl;
- }
+ hackrf_common::set_bias(dict["bias"] == "1");
}
- _buf = (unsigned short **) malloc(_buf_num * sizeof(unsigned short *));
+ _buf = (unsigned char **) malloc(_buf_num * sizeof(unsigned char *));
if (_buf) {
for(unsigned int i = 0; i < _buf_num; ++i)
- _buf[i] = (unsigned short *) malloc(_buf_len);
+ _buf[i] = (unsigned char *) malloc(_buf_len);
}
-
-// _thread = gr::thread::thread(_hackrf_wait, this);
-
- ret = hackrf_start_rx( _dev, _hackrf_rx_callback, (void *)this );
- HACKRF_THROW_ON_ERROR(ret, "Failed to start RX streaming")
}
/*
@@ -241,30 +125,6 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
*/
hackrf_source_c::~hackrf_source_c ()
{
- if (_dev) {
-// _thread.join();
- int ret = hackrf_stop_rx( _dev );
- if ( ret != HACKRF_SUCCESS )
- {
- std::cerr << HACKRF_FORMAT_ERROR(ret, "Failed to stop RX streaming") << std::endl;
- }
- ret = hackrf_close( _dev );
- if ( ret != HACKRF_SUCCESS )
- {
- std::cerr << HACKRF_FORMAT_ERROR(ret, "Failed to close HackRF") << std::endl;
- }
- _dev = NULL;
-
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- _usage--;
-
- if ( _usage == 0 )
- hackrf_exit(); /* call only once after last close */
- }
- }
-
if (_buf) {
for(unsigned int i = 0; i < _buf_num; ++i) {
free(_buf[i]);
@@ -284,7 +144,7 @@ int hackrf_source_c::_hackrf_rx_callback(hackrf_transfer *transfer)
int hackrf_source_c::hackrf_rx_callback(unsigned char *buf, uint32_t len)
{
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock(_buf_mutex);
int buf_tail = (_buf_head + _buf_used) % _buf_num;
memcpy(_buf[buf_tail], buf, len);
@@ -302,40 +162,31 @@ int hackrf_source_c::hackrf_rx_callback(unsigned char *buf, uint32_t len)
return 0; // TODO: return -1 on error/stop
}
-void hackrf_source_c::_hackrf_wait(hackrf_source_c *obj)
-{
- obj->hackrf_wait();
-}
-
-void hackrf_source_c::hackrf_wait()
-{
-}
-
bool hackrf_source_c::start()
{
- if ( ! _dev )
+ if ( ! _dev.get() )
return false;
-#if 0
- int ret = hackrf_start_rx( _dev, _hackrf_rx_callback, (void *)this );
+
+ hackrf_common::start();
+ int ret = hackrf_start_rx( _dev.get(), _hackrf_rx_callback, (void *)this );
if ( ret != HACKRF_SUCCESS ) {
std::cerr << "Failed to start RX streaming (" << ret << ")" << std::endl;
return false;
}
-#endif
return true;
}
bool hackrf_source_c::stop()
{
- if ( ! _dev )
+ if ( ! _dev.get() )
return false;
-#if 0
- int ret = hackrf_stop_rx( _dev );
+
+ hackrf_common::stop();
+ int ret = hackrf_stop_rx( _dev.get() );
if ( ret != HACKRF_SUCCESS ) {
std::cerr << "Failed to stop RX streaming (" << ret << ")" << std::endl;
return false;
}
-#endif
return true;
}
@@ -347,33 +198,41 @@ int hackrf_source_c::work( int noutput_items,
bool running = false;
- if ( _dev )
- running = (hackrf_is_streaming( _dev ) == HACKRF_TRUE);
+ if ( _dev.get() )
+ running = (hackrf_is_streaming( _dev.get() ) == HACKRF_TRUE);
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::unique_lock<std::mutex> lock(_buf_mutex);
- while (_buf_used < 3 && running) // collect at least 3 buffers
- _buf_cond.wait( lock );
+ while (_buf_used < 3 && running) { // collect at least 3 buffers
+ _buf_cond.wait_for( lock , std::chrono::milliseconds(100));
+
+ // Re-check whether the device has closed or stopped streaming
+ if ( _dev.get() )
+ running = (hackrf_is_streaming( _dev.get() ) == HACKRF_TRUE);
+ else
+ running = false;
+ }
}
if ( ! running )
return WORK_DONE;
- unsigned short *buf = _buf[_buf_head] + _buf_offset;
+ const uint8_t *buf = _buf[_buf_head] + _buf_offset * BYTES_PER_SAMPLE;
+#define TO_COMPLEX(p) gr_complex( _lut[(p)[0]], _lut[(p)[1]] )
if (noutput_items <= _samp_avail) {
for (int i = 0; i < noutput_items; ++i)
- *out++ = _lut[ *(buf + i) ];
+ *out++ = TO_COMPLEX( buf + i*BYTES_PER_SAMPLE );
_buf_offset += noutput_items;
_samp_avail -= noutput_items;
} else {
for (int i = 0; i < _samp_avail; ++i)
- *out++ = _lut[ *(buf + i) ];
+ *out++ = TO_COMPLEX( buf + i*BYTES_PER_SAMPLE );
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock(_buf_mutex);
_buf_head = (_buf_head + 1) % _buf_num;
_buf_used--;
@@ -384,7 +243,7 @@ int hackrf_source_c::work( int noutput_items,
int remaining = noutput_items - _samp_avail;
for (int i = 0; i < remaining; ++i)
- *out++ = _lut[ *(buf + i) ];
+ *out++ = TO_COMPLEX( buf + i*BYTES_PER_SAMPLE );
_buf_offset = remaining;
_samp_avail = (_buf_len / BYTES_PER_SAMPLE) - remaining;
@@ -395,78 +254,7 @@ int hackrf_source_c::work( int noutput_items,
std::vector<std::string> hackrf_source_c::get_devices()
{
- std::vector<std::string> devices;
- std::string label;
-
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- if ( _usage == 0 )
- hackrf_init(); /* call only once before the first open */
-
- _usage++;
- }
-
-#ifdef LIBHACKRF_HAVE_DEVICE_LIST
- hackrf_device_list_t *list = hackrf_device_list();
-
- for (int i = 0; i < list->devicecount; i++) {
- label = "HackRF ";
- label += hackrf_usb_board_id_name( list->usb_board_ids[i] );
-
- std::string args;
- if (list->serial_numbers[i]) {
- std::string serial = boost::lexical_cast< std::string >( list->serial_numbers[i] );
- if (serial.length() > 6)
- serial = serial.substr(serial.length() - 6, 6);
- args = "hackrf=" + serial;
- label += " " + serial;
- } else
- args = "hackrf"; /* will pick the first one, serial number is required for choosing a specific one */
-
- boost::algorithm::trim(label);
-
- args += ",label='" + label + "'";
- devices.push_back( args );
- }
-
- hackrf_device_list_free(list);
-#else
-
- int ret;
- hackrf_device *dev = NULL;
- ret = hackrf_open(&dev);
- if ( HACKRF_SUCCESS == ret )
- {
- std::string args = "hackrf=0";
-
- label = "HackRF";
-
- uint8_t board_id;
- ret = hackrf_board_id_read( dev, &board_id );
- if ( HACKRF_SUCCESS == ret )
- {
- label += std::string(" ") + hackrf_board_id_name(hackrf_board_id(board_id));
- }
-
- args += ",label='" + label + "'";
- devices.push_back( args );
-
- ret = hackrf_close(dev);
- }
-
-#endif
-
- {
- boost::mutex::scoped_lock lock( _usage_mutex );
-
- _usage--;
-
- if ( _usage == 0 )
- hackrf_exit(); /* call only once after last close */
- }
-
- return devices;
+ return hackrf_common::get_devices();
}
size_t hackrf_source_c::get_num_channels()
@@ -476,99 +264,47 @@ size_t hackrf_source_c::get_num_channels()
osmosdr::meta_range_t hackrf_source_c::get_sample_rates()
{
- osmosdr::meta_range_t range;
-
- /* we only add integer rates here because of better phase noise performance.
- * the user is allowed to request arbitrary (fractional) rates within these
- * boundaries. */
-
- range += osmosdr::range_t( 8e6 );
- range += osmosdr::range_t( 10e6 );
- range += osmosdr::range_t( 12.5e6 );
- range += osmosdr::range_t( 16e6 );
- range += osmosdr::range_t( 20e6 ); /* confirmed to work on fast machines */
-
- return range;
+ return hackrf_common::get_sample_rates();
}
double hackrf_source_c::set_sample_rate( double rate )
{
- int ret;
-
- if (_dev) {
- ret = hackrf_set_sample_rate( _dev, rate );
- if ( HACKRF_SUCCESS == ret ) {
- _sample_rate = rate;
- //set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_sample_rate", rate ) )
- }
- }
-
- return get_sample_rate();
+ return hackrf_common::set_sample_rate(rate);
}
double hackrf_source_c::get_sample_rate()
{
- return _sample_rate;
+ return hackrf_common::get_sample_rate();
}
osmosdr::freq_range_t hackrf_source_c::get_freq_range( size_t chan )
{
- osmosdr::freq_range_t range;
-
- range += osmosdr::range_t( _sample_rate / 2, 7250e6 - _sample_rate / 2 );
-
- return range;
+ return hackrf_common::get_freq_range(chan);
}
double hackrf_source_c::set_center_freq( double freq, size_t chan )
{
- int ret;
-
- #define APPLY_PPM_CORR(val, ppm) ((val) * (1.0 + (ppm) * 0.000001))
-
- if (_dev) {
- double corr_freq = APPLY_PPM_CORR( freq, _freq_corr );
- ret = hackrf_set_freq( _dev, uint64_t(corr_freq) );
- if ( HACKRF_SUCCESS == ret ) {
- _center_freq = freq;
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_freq", corr_freq ) )
- }
- }
-
- return get_center_freq( chan );
+ return hackrf_common::set_center_freq(freq, chan);
}
double hackrf_source_c::get_center_freq( size_t chan )
{
- return _center_freq;
+ return hackrf_common::get_center_freq(chan);
}
double hackrf_source_c::set_freq_corr( double ppm, size_t chan )
{
- _freq_corr = ppm;
-
- set_center_freq( _center_freq );
-
- return get_freq_corr( chan );
+ return hackrf_common::set_freq_corr(ppm, chan);
}
double hackrf_source_c::get_freq_corr( size_t chan )
{
- return _freq_corr;
+ return hackrf_common::get_freq_corr(chan);
}
std::vector<std::string> hackrf_source_c::get_gain_names( size_t chan )
{
- std::vector< std::string > names;
-
- names += "RF";
- names += "IF";
- names += "BB";
-
- return names;
+ return { "RF", "IF", "BB" };
}
osmosdr::gain_range_t hackrf_source_c::get_gain_range( size_t chan )
@@ -595,34 +331,17 @@ osmosdr::gain_range_t hackrf_source_c::get_gain_range( const std::string & name,
bool hackrf_source_c::set_gain_mode( bool automatic, size_t chan )
{
- _auto_gain = automatic;
-
- return get_gain_mode(chan);
+ return hackrf_common::set_gain_mode(automatic, chan);
}
bool hackrf_source_c::get_gain_mode( size_t chan )
{
- return _auto_gain;
+ return hackrf_common::get_gain_mode(chan);
}
double hackrf_source_c::set_gain( double gain, size_t chan )
{
- int ret;
- osmosdr::gain_range_t rf_gains = get_gain_range( "RF", chan );
-
- if (_dev) {
- double clip_gain = rf_gains.clip( gain, true );
- uint8_t value = clip_gain == 14.0f ? 1 : 0;
-
- ret = hackrf_set_amp_enable( _dev, value );
- if ( HACKRF_SUCCESS == ret ) {
- _amp_gain = clip_gain;
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_amp_enable", value ) )
- }
- }
-
- return _amp_gain;
+ return hackrf_common::set_gain(gain, chan);
}
double hackrf_source_c::set_gain( double gain, const std::string & name, size_t chan)
@@ -644,7 +363,7 @@ double hackrf_source_c::set_gain( double gain, const std::string & name, size_t
double hackrf_source_c::get_gain( size_t chan )
{
- return _amp_gain;
+ return hackrf_common::get_gain(chan);
}
double hackrf_source_c::get_gain( const std::string & name, size_t chan )
@@ -669,10 +388,10 @@ double hackrf_source_c::set_if_gain(double gain, size_t chan)
int ret;
osmosdr::gain_range_t rf_gains = get_gain_range( "IF", chan );
- if (_dev) {
+ if (_dev.get()) {
double clip_gain = rf_gains.clip( gain, true );
- ret = hackrf_set_lna_gain( _dev, uint32_t(clip_gain) );
+ ret = hackrf_set_lna_gain( _dev.get(), uint32_t(clip_gain) );
if ( HACKRF_SUCCESS == ret ) {
_lna_gain = clip_gain;
} else {
@@ -688,10 +407,10 @@ double hackrf_source_c::set_bb_gain( double gain, size_t chan )
int ret;
osmosdr::gain_range_t if_gains = get_gain_range( "BB", chan );
- if (_dev) {
+ if (_dev.get()) {
double clip_gain = if_gains.clip( gain, true );
- ret = hackrf_set_vga_gain( _dev, uint32_t(clip_gain) );
+ ret = hackrf_set_vga_gain( _dev.get(), uint32_t(clip_gain) );
if ( HACKRF_SUCCESS == ret ) {
_vga_gain = clip_gain;
} else {
@@ -704,72 +423,30 @@ double hackrf_source_c::set_bb_gain( double gain, size_t chan )
std::vector< std::string > hackrf_source_c::get_antennas( size_t chan )
{
- std::vector< std::string > antennas;
-
- antennas += get_antenna( chan );
-
- return antennas;
+ return hackrf_common::get_antennas(chan);
}
std::string hackrf_source_c::set_antenna( const std::string & antenna, size_t chan )
{
- return get_antenna( chan );
+ return hackrf_common::set_antenna(antenna, chan);
}
std::string hackrf_source_c::get_antenna( size_t chan )
{
- return "TX/RX";
+ return hackrf_common::get_antenna(chan);
}
double hackrf_source_c::set_bandwidth( double bandwidth, size_t chan )
{
- int ret;
-// osmosdr::freq_range_t bandwidths = get_bandwidth_range( chan );
-
- if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */
- bandwidth = _sample_rate * 0.75; /* select narrower filters to prevent aliasing */
-
- if ( _dev ) {
- /* compute best default value depending on sample rate (auto filter) */
- uint32_t bw = hackrf_compute_baseband_filter_bw( uint32_t(bandwidth) );
- ret = hackrf_set_baseband_filter_bandwidth( _dev, bw );
- if ( HACKRF_SUCCESS == ret ) {
- _bandwidth = bw;
- } else {
- HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_baseband_filter_bandwidth", bw ) )
- }
- }
-
- return _bandwidth;
+ return hackrf_common::set_bandwidth(bandwidth, chan);
}
double hackrf_source_c::get_bandwidth( size_t chan )
{
- return _bandwidth;
+ return hackrf_common::get_bandwidth(chan);
}
osmosdr::freq_range_t hackrf_source_c::get_bandwidth_range( size_t chan )
{
- osmosdr::freq_range_t bandwidths;
-
- // TODO: read out from libhackrf when an API is available
-
- bandwidths += osmosdr::range_t( 1750000 );
- bandwidths += osmosdr::range_t( 2500000 );
- bandwidths += osmosdr::range_t( 3500000 );
- bandwidths += osmosdr::range_t( 5000000 );
- bandwidths += osmosdr::range_t( 5500000 );
- bandwidths += osmosdr::range_t( 6000000 );
- bandwidths += osmosdr::range_t( 7000000 );
- bandwidths += osmosdr::range_t( 8000000 );
- bandwidths += osmosdr::range_t( 9000000 );
- bandwidths += osmosdr::range_t( 10000000 );
- bandwidths += osmosdr::range_t( 12000000 );
- bandwidths += osmosdr::range_t( 14000000 );
- bandwidths += osmosdr::range_t( 15000000 );
- bandwidths += osmosdr::range_t( 20000000 );
- bandwidths += osmosdr::range_t( 24000000 );
- bandwidths += osmosdr::range_t( 28000000 );
-
- return bandwidths;
+ return hackrf_common::get_bandwidth_range(chan);
}
diff --git a/lib/hackrf/hackrf_source_c.h b/lib/hackrf/hackrf_source_c.h
index 6ae81d2..55a0fbb 100644
--- a/lib/hackrf/hackrf_source_c.h
+++ b/lib/hackrf/hackrf_source_c.h
@@ -1,41 +1,40 @@
/* -*- c++ -*- */
/*
* Copyright 2013 Dimitri Stolnikov <horiz0n@gmx.net>
+ * Copyright 2020 Clayton Smith <argilo@gmail.com>
*
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
+ * gr-osmosdr 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, or (at your option)
* any later version.
*
- * GNU Radio is distributed in the hope that it will be useful,
+ * gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+ * along with gr-osmosdr; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_HACKRF_SOURCE_C_H
#define INCLUDED_HACKRF_SOURCE_C_H
-#include <gnuradio/thread/thread.h>
#include <gnuradio/sync_block.h>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+#include <condition_variable>
+#include <mutex>
#include <libhackrf/hackrf.h>
#include "source_iface.h"
+#include "hackrf_common.h"
class hackrf_source_c;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr::blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -43,9 +42,9 @@ class hackrf_source_c;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<hackrf_source_c> hackrf_source_c_sptr;
+typedef std::shared_ptr<hackrf_source_c> hackrf_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of hackrf_source_c.
@@ -62,12 +61,12 @@ hackrf_source_c_sptr make_hackrf_source_c (const std::string & args = "");
*/
class hackrf_source_c :
public gr::sync_block,
- public source_iface
+ public source_iface,
+ protected hackrf_common
{
private:
// The friend declaration allows make_hackrf_source_c to
// access the private constructor.
-
friend hackrf_source_c_sptr make_hackrf_source_c (const std::string & args);
/*!
@@ -123,35 +122,22 @@ public:
private:
static int _hackrf_rx_callback(hackrf_transfer* transfer);
int hackrf_rx_callback(unsigned char *buf, uint32_t len);
- static void _hackrf_wait(hackrf_source_c *obj);
- void hackrf_wait();
-
- static int _usage;
- static boost::mutex _usage_mutex;
- std::vector<gr_complex> _lut;
+ std::vector<float> _lut;
- hackrf_device *_dev;
- gr::thread::thread _thread;
- unsigned short **_buf;
+ unsigned char **_buf;
unsigned int _buf_num;
unsigned int _buf_len;
unsigned int _buf_head;
unsigned int _buf_used;
- boost::mutex _buf_mutex;
- boost::condition_variable _buf_cond;
+ std::mutex _buf_mutex;
+ std::condition_variable _buf_cond;
unsigned int _buf_offset;
int _samp_avail;
- double _sample_rate;
- double _center_freq;
- double _freq_corr;
- bool _auto_gain;
- double _amp_gain;
double _lna_gain;
double _vga_gain;
- double _bandwidth;
};
#endif /* INCLUDED_HACKRF_SOURCE_C_H */
diff --git a/lib/miri/CMakeLists.txt b/lib/miri/CMakeLists.txt
index ddaeb0a..672fc90 100644
--- a/lib/miri/CMakeLists.txt
+++ b/lib/miri/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,17 +21,16 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${LIBMIRISDR_INCLUDE_DIRS}
)
-set(mirisdr_srcs
- ${CMAKE_CURRENT_SOURCE_DIR}/miri_source_c.cc
+APPEND_LIB_LIST(
+ ${LIBMIRISDR_LIBRARIES}
)
-########################################################################
-# Append gnuradio-mirisdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${mirisdr_srcs})
-list(APPEND gr_osmosdr_libs ${LIBMIRISDR_LIBRARIES})
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/miri_source_c.cc
+)
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/miri/miri_source_c.cc b/lib/miri/miri_source_c.cc
index c9f81fa..c1b9428 100644
--- a/lib/miri/miri_source_c.cc
+++ b/lib/miri/miri_source_c.cc
@@ -182,7 +182,7 @@ void miri_source_c::mirisdr_callback(unsigned char *buf, uint32_t len)
}
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock( _buf_mutex );
if (len > BUF_SIZE)
throw std::runtime_error("Buffer too small.");
@@ -226,7 +226,7 @@ int miri_source_c::work( int noutput_items,
gr_complex *out = (gr_complex *)output_items[0];
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::unique_lock<std::mutex> lock( _buf_mutex );
while (_buf_used < 3 && _running) // collect at least 3 buffers
_buf_cond.wait( lock );
@@ -250,7 +250,7 @@ int miri_source_c::work( int noutput_items,
float(*(buf + i * 2 + 1)) * (1.0f/4096.0f) );
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock( _buf_mutex );
_buf_head = (_buf_head + 1) % _buf_num;
_buf_used--;
diff --git a/lib/miri/miri_source_c.h b/lib/miri/miri_source_c.h
index 5363db5..9da0644 100644
--- a/lib/miri/miri_source_c.h
+++ b/lib/miri/miri_source_c.h
@@ -23,26 +23,16 @@
#include <gnuradio/sync_block.h>
#include <gnuradio/thread/thread.h>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+
+#include <mutex>
+#include <condition_variable>
#include "source_iface.h"
class miri_source_c;
typedef struct mirisdr_dev mirisdr_dev_t;
-/*
- * We use boost::shared_ptr's instead of raw pointers for all access
- * to gr::blocks (and many other data structures). The shared_ptr gets
- * us transparent reference counting, which greatly simplifies storage
- * management issues. This is especially helpful in our hybrid
- * C++ / Python system.
- *
- * See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
- *
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
- */
-typedef boost::shared_ptr<miri_source_c> miri_source_c_sptr;
+typedef std::shared_ptr<miri_source_c> miri_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of miri_source_c.
@@ -120,8 +110,8 @@ private:
unsigned int _buf_num;
unsigned int _buf_head;
unsigned int _buf_used;
- boost::mutex _buf_mutex;
- boost::condition_variable _buf_cond;
+ std::mutex _buf_mutex;
+ std::condition_variable _buf_cond;
bool _running;
unsigned int _buf_offset;
diff --git a/lib/osmosdr/osmosdr_src_c.cc b/lib/osmosdr/osmosdr_src_c.cc
deleted file mode 100644
index de65373..0000000
--- a/lib/osmosdr/osmosdr_src_c.cc
+++ /dev/null
@@ -1,533 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2012 Dimitri Stolnikov <horiz0n@gmx.net>
- *
- * GNU Radio 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, or (at your option)
- * any later version.
- *
- * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-/*
- * config.h is generated by configure. It contains the results
- * of probing for features, options etc. It should be the first
- * file included in your .cc file.
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "osmosdr_src_c.h"
-#include <gnuradio/io_signature.h>
-
-#include <boost/assign.hpp>
-#include <boost/format.hpp>
-
-#include <stdexcept>
-#include <iostream>
-#include <stdio.h>
-
-#include <osmosdr.h>
-
-#include "arg_helpers.h"
-
-using namespace boost::assign;
-
-#define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */
-#define BUF_NUM 15
-#define BUF_SKIP 1 // buffers to skip due to garbage
-
-#define BYTES_PER_SAMPLE 4 // osmosdr device delivers 16 bit signed IQ data
-
-/*
- * Create a new instance of osmosdr_src_c and return
- * a boost shared_ptr. This is effectively the public constructor.
- */
-osmosdr_src_c_sptr
-osmosdr_make_src_c (const std::string &args)
-{
- return gnuradio::get_initial_sptr(new osmosdr_src_c (args));
-}
-
-/*
- * The private constructor
- */
-osmosdr_src_c::osmosdr_src_c (const std::string &args)
- : gr::sync_block ("osmosdr_src_c",
- gr::io_signature::make(0, 0, sizeof (gr_complex)),
- gr::io_signature::make(1, 1, sizeof (gr_complex)) ),
- _dev(NULL),
- _buf(NULL),
- _running(true),
- _auto_gain(false),
- _if_gain(0),
- _skipped(0)
-{
- int ret;
- unsigned int dev_index = 0;
-
- dict_t dict = params_to_dict(args);
-
- if (dict.count("osmosdr"))
- dev_index = boost::lexical_cast< unsigned int >( dict["osmosdr"] );
-
- _buf_num = _buf_len = _buf_head = _buf_used = _buf_offset = 0;
-
- if (dict.count("buffers"))
- _buf_num = boost::lexical_cast< unsigned int >( dict["buffers"] );
-
- if (dict.count("buflen"))
- _buf_len = boost::lexical_cast< unsigned int >( dict["buflen"] );
-
- if (0 == _buf_num)
- _buf_num = BUF_NUM;
-
- if (0 == _buf_len || _buf_len % 512 != 0) /* len must be multiple of 512 */
- _buf_len = BUF_LEN;
-
- if ( BUF_NUM != _buf_num || BUF_LEN != _buf_len ) {
- std::cerr << "Using " << _buf_num << " buffers of size " << _buf_len << "."
- << std::endl;
- }
-
- _samp_avail = _buf_len / BYTES_PER_SAMPLE;
-
- if ( dev_index >= osmosdr_get_device_count() )
- throw std::runtime_error("Wrong osmosdr device index given.");
-
- std::cerr << "Using device #" << dev_index << ": "
- << osmosdr_get_device_name(dev_index)
- << std::endl;
-
- _dev = NULL;
- ret = osmosdr_open( &_dev, dev_index );
- if (ret < 0)
- throw std::runtime_error("Failed to open osmosdr device.");
-
- ret = osmosdr_set_fpga_iq_swap(_dev, 0);
- if (ret < 0)
- throw std::runtime_error("Failed to disable IQ swapping.");
-
- ret = osmosdr_set_sample_rate( _dev, 500000 );
- if (ret < 0)
- throw std::runtime_error("Failed to set default samplerate.");
-
- ret = osmosdr_set_tuner_gain_mode(_dev, int(!_auto_gain));
- if (ret < 0)
- throw std::runtime_error("Failed to enable manual gain mode.");
-
- ret = osmosdr_reset_buffer( _dev );
- if (ret < 0)
- throw std::runtime_error("Failed to reset usb buffers.");
-
- set_if_gain( 24 ); /* preset to a reasonable default (non-GRC use case) */
-
- _buf = (unsigned short **) malloc(_buf_num * sizeof(unsigned short *));
-
- if (_buf) {
- for(unsigned int i = 0; i < _buf_num; ++i)
- _buf[i] = (unsigned short *) malloc(_buf_len);
- }
-
- _thread = gr::thread::thread(_osmosdr_wait, this);
-}
-
-/*
- * Our virtual destructor.
- */
-osmosdr_src_c::~osmosdr_src_c ()
-{
- if (_dev) {
- _running = false;
- osmosdr_cancel_async( _dev );
- _thread.join();
- osmosdr_close( _dev );
- _dev = NULL;
- }
-
- if (_buf) {
- for(unsigned int i = 0; i < _buf_num; ++i) {
- free(_buf[i]);
- }
-
- free(_buf);
- _buf = NULL;
- }
-}
-
-void osmosdr_src_c::_osmosdr_callback(unsigned char *buf, uint32_t len, void *ctx)
-{
- osmosdr_src_c *obj = (osmosdr_src_c *)ctx;
- obj->osmosdr_callback(buf, len);
-}
-
-void osmosdr_src_c::osmosdr_callback(unsigned char *buf, uint32_t len)
-{
- if (_skipped < BUF_SKIP) {
- _skipped++;
- return;
- }
-
- {
- boost::mutex::scoped_lock lock( _buf_mutex );
-
- int buf_tail = (_buf_head + _buf_used) % _buf_num;
- memcpy(_buf[buf_tail], buf, len);
-
- if (_buf_used == _buf_num) {
- std::cerr << "O" << std::flush;
- _buf_head = (_buf_head + 1) % _buf_num;
- } else {
- _buf_used++;
- }
- }
-
- _buf_cond.notify_one();
-}
-
-void osmosdr_src_c::_osmosdr_wait(osmosdr_src_c *obj)
-{
- obj->osmosdr_wait();
-}
-
-void osmosdr_src_c::osmosdr_wait()
-{
- int ret = osmosdr_read_async( _dev, _osmosdr_callback, (void *)this, _buf_num, _buf_len );
-
- _running = false;
-
- if ( ret != 0 )
- std::cerr << "osmosdr_read_async returned with " << ret << std::endl;
-
- _buf_cond.notify_one();
-}
-
-int osmosdr_src_c::work( int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items )
-{
- gr_complex *out = (gr_complex *)output_items[0];
-
- {
- boost::mutex::scoped_lock lock( _buf_mutex );
-
- while (_buf_used < 3 && _running) // collect at least 3 buffers
- _buf_cond.wait( lock );
- }
-
- if (!_running)
- return WORK_DONE;
-
- short *buf = (short *)_buf[_buf_head] + _buf_offset;
-
- if (noutput_items <= _samp_avail) {
- for (int i = 0; i < noutput_items; i++)
- *out++ = gr_complex( float(*(buf + i * 2 + 0)) * (1.0f/32767.5f),
- float(*(buf + i * 2 + 1)) * (1.0f/32767.5f) );
-
- _buf_offset += noutput_items * 2;
- _samp_avail -= noutput_items;
- } else {
- for (int i = 0; i < _samp_avail; i++)
- *out++ = gr_complex( float(*(buf + i * 2 + 0)) * (1.0f/32767.5f),
- float(*(buf + i * 2 + 1)) * (1.0f/32767.5f) );
-
- {
- boost::mutex::scoped_lock lock( _buf_mutex );
-
- _buf_head = (_buf_head + 1) % _buf_num;
- _buf_used--;
- }
-
- buf = (short *)_buf[_buf_head];
-
- int remaining = noutput_items - _samp_avail;
-
- for (int i = 0; i < remaining; i++)
- *out++ = gr_complex( float(*(buf + i * 2 + 0)) * (1.0f/32767.5f),
- float(*(buf + i * 2 + 1)) * (1.0f/32767.5f) );
-
- _buf_offset = remaining * 2;
- _samp_avail = (_buf_len / BYTES_PER_SAMPLE) - remaining;
- }
-
- return noutput_items;
-}
-
-std::vector<std::string> osmosdr_src_c::get_devices()
-{
- std::vector< std::string > devices;
- char buffer[256];
-
- for (unsigned int i = 0; i < osmosdr_get_device_count(); i++) {
- std::string args = "osmosdr=" + boost::lexical_cast< std::string >( i );
-
- std::string label = std::string(osmosdr_get_device_name( i ));
-
- memset(buffer, 0, sizeof(buffer));
- osmosdr_get_device_usb_strings( i, NULL, NULL, buffer );
- std::string serial = std::string(buffer);
-
- if (serial.length())
- label += " " + serial;
-
- args += ",label='" + label + + "'";
-
- devices.push_back( args );
- }
-
- return devices;
-}
-
-size_t osmosdr_src_c::get_num_channels()
-{
- return 1;
-}
-
-osmosdr::meta_range_t osmosdr_src_c::get_sample_rates()
-{
- osmosdr::meta_range_t range;
-
- if (_dev) {
- int count = osmosdr_get_sample_rates(_dev, NULL);
- if (count > 0) {
- uint32_t* rates = new uint32_t[ count ];
- count = osmosdr_get_sample_rates(_dev, rates);
- for (int i = 0; i < count; i++)
- range += osmosdr::range_t( rates[i] );
- delete[] rates;
- }
- }
-
- return range;
-}
-
-double osmosdr_src_c::set_sample_rate(double rate)
-{
- if (_dev) {
- osmosdr_set_sample_rate( _dev, (uint32_t)rate );
- }
-
- return get_sample_rate();
-}
-
-double osmosdr_src_c::get_sample_rate()
-{
- if (_dev)
- return (double)osmosdr_get_sample_rate( _dev );
-
- return 0;
-}
-
-osmosdr::freq_range_t osmosdr_src_c::get_freq_range( size_t chan )
-{
- osmosdr::freq_range_t range;
-
- /* there is a (temperature dependent) gap between 1100 to 1250 MHz */
- range += osmosdr::range_t( 52e6, 2.2e9 );
-
- return range;
-}
-
-double osmosdr_src_c::set_center_freq( double freq, size_t chan )
-{
- if (_dev)
- osmosdr_set_center_freq( _dev, (uint32_t)freq );
-
- return get_center_freq( chan );
-}
-
-double osmosdr_src_c::get_center_freq( size_t chan )
-{
- if (_dev)
- return (double)osmosdr_get_center_freq( _dev );
-
- return 0;
-}
-
-double osmosdr_src_c::set_freq_corr( double ppm, size_t chan )
-{
- return get_freq_corr( chan );
-}
-
-double osmosdr_src_c::get_freq_corr( size_t chan )
-{
- return 0;
-}
-
-std::vector<std::string> osmosdr_src_c::get_gain_names( size_t chan )
-{
- std::vector< std::string > names;
-
- names += "LNA";
- names += "IF";
-
- return names;
-}
-
-osmosdr::gain_range_t osmosdr_src_c::get_gain_range( size_t chan )
-{
- osmosdr::gain_range_t range;
-
- if (_dev) {
- int count = osmosdr_get_tuner_gains(_dev, NULL);
- if (count > 0) {
- int* gains = new int[ count ];
- count = osmosdr_get_tuner_gains(_dev, gains);
- for (int i = 0; i < count; i++)
- range += osmosdr::range_t( gains[i] / 10.0 );
- delete[] gains;
- }
- }
-
- return range;
-}
-
-osmosdr::gain_range_t osmosdr_src_c::get_gain_range( const std::string & name, size_t chan )
-{
- if ( "IF" == name ) {
- return osmosdr::gain_range_t(3, 56, 1);
- }
-
- return get_gain_range( chan );
-}
-
-bool osmosdr_src_c::set_gain_mode( bool automatic, size_t chan )
-{
- if (_dev) {
- if (!osmosdr_set_tuner_gain_mode(_dev, int(!automatic))) {
- _auto_gain = automatic;
- }
- }
-
- return get_gain_mode(chan);
-}
-
-bool osmosdr_src_c::get_gain_mode( size_t chan )
-{
- return _auto_gain;
-}
-
-double osmosdr_src_c::set_gain( double gain, size_t chan )
-{
- osmosdr::gain_range_t rf_gains = osmosdr_src_c::get_gain_range( chan );
-
- if (_dev) {
- osmosdr_set_tuner_gain( _dev, int(rf_gains.clip(gain) * 10.0) );
- }
-
- return get_gain( chan );
-}
-
-double osmosdr_src_c::set_gain( double gain, const std::string & name, size_t chan)
-{
- if ( "IF" == name ) {
- return set_if_gain( gain, chan );
- }
-
- return set_gain( gain, chan );
-}
-
-double osmosdr_src_c::get_gain( size_t chan )
-{
- if ( _dev )
- return ((double)osmosdr_get_tuner_gain( _dev )) / 10.0;
-
- return 0;
-}
-
-double osmosdr_src_c::get_gain( const std::string & name, size_t chan )
-{
- if ( "IF" == name ) {
- return _if_gain;
- }
-
- return get_gain( chan );
-}
-
-double osmosdr_src_c::set_if_gain(double gain, size_t chan)
-{
- std::vector< osmosdr::gain_range_t > if_gains;
-
- if_gains += osmosdr::gain_range_t(-3, 6, 9);
- if_gains += osmosdr::gain_range_t(0, 9, 3);
- if_gains += osmosdr::gain_range_t(0, 9, 3);
- if_gains += osmosdr::gain_range_t(0, 2, 1);
- if_gains += osmosdr::gain_range_t(3, 15, 3);
- if_gains += osmosdr::gain_range_t(3, 15, 3);
-
- std::map< int, double > gains;
-
- /* initialize with min gains */
- for (unsigned int i = 0; i < if_gains.size(); i++) {
- gains[ i + 1 ] = if_gains[ i ].start();
- }
-
- for (int i = if_gains.size() - 1; i >= 0; i--) {
- osmosdr::gain_range_t range = if_gains[ i ];
-
- double error = gain;
-
- for( double g = range.start(); g <= range.stop(); g += range.step() ) {
-
- double sum = 0;
- for (int j = 0; j < int(gains.size()); j++) {
- if ( i == j )
- sum += g;
- else
- sum += gains[ j + 1 ];
- }
-
- double err = abs(gain - sum);
- if (err < error) {
- error = err;
- gains[ i + 1 ] = g;
- }
- }
- }
-#if 0
- std::cerr << gain << " => "; double sum = 0;
- for (unsigned int i = 0; i < gains.size(); i++) {
- sum += gains[ i + 1 ];
- std::cerr << gains[ i + 1 ] << " ";
- }
- std::cerr << " = " << sum << std::endl;
-#endif
- if (_dev) {
- for (unsigned int stage = 1; stage <= gains.size(); stage++) {
- osmosdr_set_tuner_if_gain( _dev, stage, int(gains[ stage ] * 10.0));
- }
- }
-
- _if_gain = gain;
- return gain;
-}
-
-std::vector< std::string > osmosdr_src_c::get_antennas( size_t chan )
-{
- std::vector< std::string > antennas;
-
- antennas += get_antenna( chan );
-
- return antennas;
-}
-
-std::string osmosdr_src_c::set_antenna( const std::string & antenna, size_t chan )
-{
- return get_antenna( chan );
-}
-
-std::string osmosdr_src_c::get_antenna( size_t chan )
-{
- return "RX";
-}
diff --git a/lib/ranges.cc b/lib/ranges.cc
index cdff969..09c1dae 100644
--- a/lib/ranges.cc
+++ b/lib/ranges.cc
@@ -18,7 +18,6 @@
#include <osmosdr/ranges.h>
#include <stdexcept>
#include <boost/math/special_functions/round.hpp>
-#include <boost/foreach.hpp>
#include <algorithm>
#include <sstream>
@@ -102,7 +101,7 @@ meta_range_t::meta_range_t(
double meta_range_t::start(void) const{
check_meta_range_monotonic(*this);
double min_start = this->front().start();
- BOOST_FOREACH(const range_t &r, (*this)){
+ for (const range_t &r : (*this)){
min_start = std::min(min_start, r.start());
}
return min_start;
@@ -111,7 +110,7 @@ double meta_range_t::start(void) const{
double meta_range_t::stop(void) const{
check_meta_range_monotonic(*this);
double max_stop = this->front().stop();
- BOOST_FOREACH(const range_t &r, (*this)){
+ for (const range_t &r : (*this)){
max_stop = std::max(max_stop, r.stop());
}
return max_stop;
@@ -121,7 +120,7 @@ double meta_range_t::step(void) const{
check_meta_range_monotonic(*this);
std::vector<double> non_zero_steps;
range_t last = this->front();
- BOOST_FOREACH(const range_t &r, (*this)){
+ for (const range_t &r : (*this)){
//steps at each range
if (r.step() > 0) non_zero_steps.push_back(r.step());
//and steps in-between ranges
@@ -137,7 +136,7 @@ double meta_range_t::step(void) const{
double meta_range_t::clip(double value, bool clip_step) const{
check_meta_range_monotonic(*this);
double last_stop = this->front().stop();
- BOOST_FOREACH(const range_t &r, (*this)){
+ for (const range_t &r : (*this)){
//in-between ranges, clip to nearest
if (value < r.start()){
return (std::abs(value - r.start()) < std::abs(value - last_stop))?
@@ -157,7 +156,7 @@ double meta_range_t::clip(double value, bool clip_step) const{
std::vector<double> meta_range_t::values() const {
std::vector<double> values;
- BOOST_FOREACH(const range_t &r, (*this)) {
+ for (const range_t &r : (*this)) {
if (r.start() != r.stop()) {
if ( r.step() == 0 ) {
values.push_back( r.start() );
@@ -177,7 +176,7 @@ std::vector<double> meta_range_t::values() const {
const std::string meta_range_t::to_pp_string(void) const{
std::stringstream ss;
- BOOST_FOREACH(const range_t &r, (*this)){
+ for (const range_t &r : (*this)){
ss << r.to_pp_string() << std::endl;
}
return ss.str();
diff --git a/lib/redpitaya/CMakeLists.txt b/lib/redpitaya/CMakeLists.txt
index a14dc9e..e17c518 100644
--- a/lib/redpitaya/CMakeLists.txt
+++ b/lib/redpitaya/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,18 +21,23 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
-set(redpitaya_srcs
+APPEND_LIB_LIST(
+ ${Gnuradio-blocks_LIBRARIES}
+)
+
+if(WIN32)
+ APPEND_LIB_LIST(
+ ws2_32
+ )
+endif()
+
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/redpitaya_source_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/redpitaya_sink_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/redpitaya_common.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${redpitaya_srcs})
-#list(APPEND gr_osmosdr_libs ${GNURADIO_BLOCKS_LIBRARIES})
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/redpitaya/redpitaya_common.h b/lib/redpitaya/redpitaya_common.h
index 1983176..2e1b09e 100644
--- a/lib/redpitaya/redpitaya_common.h
+++ b/lib/redpitaya/redpitaya_common.h
@@ -26,7 +26,6 @@
#if defined(_WIN32)
#include <winsock2.h>
#include <ws2tcpip.h>
-#pragma comment(lib, "ws2_32.lib")
#include <windows.h>
#define INVSOC INVALID_SOCKET
#else
diff --git a/lib/redpitaya/redpitaya_sink_c.h b/lib/redpitaya/redpitaya_sink_c.h
index e03a13a..fceaa77 100644
--- a/lib/redpitaya/redpitaya_sink_c.h
+++ b/lib/redpitaya/redpitaya_sink_c.h
@@ -29,7 +29,7 @@
class redpitaya_sink_c;
-typedef boost::shared_ptr< redpitaya_sink_c > redpitaya_sink_c_sptr;
+typedef std::shared_ptr< redpitaya_sink_c > redpitaya_sink_c_sptr;
redpitaya_sink_c_sptr make_redpitaya_sink_c( const std::string & args = "" );
diff --git a/lib/redpitaya/redpitaya_source_c.h b/lib/redpitaya/redpitaya_source_c.h
index 7d536ee..f4a2d80 100644
--- a/lib/redpitaya/redpitaya_source_c.h
+++ b/lib/redpitaya/redpitaya_source_c.h
@@ -29,7 +29,7 @@
class redpitaya_source_c;
-typedef boost::shared_ptr< redpitaya_source_c > redpitaya_source_c_sptr;
+typedef std::shared_ptr< redpitaya_source_c > redpitaya_source_c_sptr;
redpitaya_source_c_sptr make_redpitaya_source_c( const std::string & args = "" );
diff --git a/lib/rfspace/CMakeLists.txt b/lib/rfspace/CMakeLists.txt
index eebc15d..c096550 100644
--- a/lib/rfspace/CMakeLists.txt
+++ b/lib/rfspace/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,17 +21,11 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
-set(rfspace_srcs
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/rfspace_source_c.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${rfspace_srcs})
-#list(APPEND gr_osmosdr_libs ...)
-
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/rfspace/rfspace_source_c.cc b/lib/rfspace/rfspace_source_c.cc
index 80f34df..c6510c5 100644
--- a/lib/rfspace/rfspace_source_c.cc
+++ b/lib/rfspace/rfspace_source_c.cc
@@ -27,7 +27,6 @@
#include "config.h"
#endif
-#ifndef USE_ASIO
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -35,7 +34,6 @@
#include <netinet/udp.h>
#include <arpa/inet.h>
#include <netdb.h>
-#endif
#include <fcntl.h>
#include <unistd.h>
@@ -54,9 +52,6 @@
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
-#ifdef USE_ASIO
-#include <boost/asio/deadline_timer.hpp>
-#endif
#include <gnuradio/io_signature.h>
@@ -64,9 +59,6 @@
#include "rfspace_source_c.h"
using namespace boost::assign;
-#ifdef USE_ASIO
-using boost::asio::deadline_timer;
-#endif
#define DEFAULT_HOST "127.0.0.1" /* We assume a running "siqs" from CuteSDR project */
#define DEFAULT_PORT 50000
@@ -102,15 +94,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
gr::io_signature::make (MIN_IN, MAX_IN, sizeof (gr_complex)),
gr::io_signature::make (MIN_OUT, MAX_OUT, sizeof (gr_complex))),
_radio(RADIO_UNKNOWN),
-#ifdef USE_ASIO
- _io_service(),
- _resolver(_io_service),
- _t(_io_service),
- _u(_io_service),
-#else
_tcp(-1),
_udp(-1),
-#endif
_usb(-1),
_running(false),
_keep_running(false),
@@ -137,6 +122,9 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
if ( dict.count("cloudiq") )
dict["rfspace"] = dict["cloudiq"];
+ if ( dict.count("cloudsdr") )
+ dict["rfspace"] = dict["cloudsdr"];
+
if ( dict.count("rfspace") )
{
std::string value = dict["rfspace"];
@@ -161,6 +149,9 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
if ( first.count("cloudiq") )
value = first["cloudiq"];
+ if ( first.count("cloudsdr") )
+ value = first["cloudsdr"];
+
dict["rfspace"] = value;
dict["label"] = first["label"];
}
@@ -239,30 +230,6 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
/* SDR-IP 4.4.4 Data Output UDP IP and Port Address */
/* NETSDR 4.4.3 Data Output UDP IP and Port Address */
-#ifdef USE_ASIO
-
- tcp::resolver::query query(tcp::v4(), host.c_str(), port_str.c_str());
- tcp::resolver::iterator iterator = _resolver.resolve(query);
-
- boost::system::error_code ec;
-
- boost::asio::connect(_t, iterator, ec);
- if ( ec )
- throw std::runtime_error(ec.message() + " (" + host + ":" + port_str + ")");
-
- _u.open(udp::v4(), ec);
- if ( ec )
- throw std::runtime_error(ec.message());
-
- _u.bind(udp::endpoint(udp::v4(), DEFAULT_PORT), ec);
- if ( ec )
- throw std::runtime_error(ec.message());
-
- _u.set_option(udp::socket::reuse_address(true));
- _t.set_option(udp::socket::reuse_address(true));
-
-#else
-
if ( (_tcp = socket(AF_INET, SOCK_STREAM, 0) ) < 0)
{
throw std::runtime_error("Could not create TCP socket");
@@ -330,7 +297,7 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
memset(&host_sa, 0, sizeof(host_sa));
host_sa.sin_family = AF_INET;
host_sa.sin_addr.s_addr = htonl(INADDR_ANY);
- host_sa.sin_port = htons(DEFAULT_PORT);
+ host_sa.sin_port = htons(port); /* host port must match sdr port */
if ( bind(_udp, (struct sockaddr *)&host_sa, sizeof(host_sa)) < 0 )
{
@@ -339,8 +306,6 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
throw std::runtime_error("Bind of UDP socket failed: " + std::string(strerror(errno)));
}
-#endif
-
}
/* Wait 10 ms before sending queries to device (required for networked radios). */
@@ -377,6 +342,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
_radio = RFSPACE_NETSDR;
else if ( 0x434C4951 == product_id ) /* CloudIQ Product ID */
_radio = RFSPACE_CLOUDIQ;
+ else if ( 0x434C5344 == product_id ) /* CloudSDR Product ID */
+ _radio = RFSPACE_CLOUDSDR;
else
std::cerr << "UNKNOWN ";
}
@@ -415,7 +382,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
if ( RFSPACE_NETSDR == _radio ||
RFSPACE_SDR_IP == _radio ||
- RFSPACE_CLOUDIQ == _radio)
+ RFSPACE_CLOUDIQ == _radio ||
+ RFSPACE_CLOUDSDR == _radio)
{
unsigned char hardver[] = { 0x05, 0x20, 0x04, 0x00, 0x02 };
if ( transaction( hardver, sizeof(hardver), response ) )
@@ -423,7 +391,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
}
if ( RFSPACE_NETSDR == _radio ||
- RFSPACE_CLOUDIQ == _radio)
+ RFSPACE_CLOUDIQ == _radio ||
+ RFSPACE_CLOUDSDR == _radio)
{
unsigned char fpgaver[] = { 0x05, 0x20, 0x04, 0x00, 0x03 };
if ( transaction( fpgaver, sizeof(fpgaver), response ) )
@@ -472,7 +441,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
set_bandwidth( 0 ); /* switch to automatic filter selection by default */
}
- else if ( RFSPACE_CLOUDIQ == _radio)
+ else if ( RFSPACE_CLOUDIQ == _radio ||
+ RFSPACE_CLOUDSDR == _radio)
{
set_sample_rate( 240000 );
set_bandwidth( 0 );
@@ -481,7 +451,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
/* start TCP keepalive thread */
if ( RFSPACE_NETSDR == _radio ||
RFSPACE_SDR_IP == _radio ||
- RFSPACE_CLOUDIQ == _radio )
+ RFSPACE_CLOUDIQ == _radio ||
+ RFSPACE_CLOUDSDR == _radio )
{
_run_tcp_keepalive_task = true;
_thread = gr::thread::thread( boost::bind(&rfspace_source_c::tcp_keepalive_task, this) );
@@ -506,10 +477,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
*/
rfspace_source_c::~rfspace_source_c ()
{
-#ifndef USE_ASIO
close(_tcp);
close(_udp);
-#endif
if ( RFSPACE_SDR_IQ == _radio )
{
@@ -590,7 +559,7 @@ bool rfspace_source_c::transaction( const unsigned char *cmd, size_t size,
if ( write(_usb, cmd, size) != (int)size )
return false;
- boost::unique_lock<boost::mutex> lock(_resp_lock);
+ std::unique_lock<std::mutex> lock(_resp_lock);
_resp_avail.wait(lock);
rx_bytes = _resp.size();
@@ -598,13 +567,8 @@ bool rfspace_source_c::transaction( const unsigned char *cmd, size_t size,
}
else
{
- boost::mutex::scoped_lock lock(_tcp_lock);
-
-#ifdef USE_ASIO
- _t.write_some( boost::asio::buffer(cmd, size) );
+ std::lock_guard<std::mutex> lock(_tcp_lock);
- rx_bytes = _t.read_some( boost::asio::buffer(data, sizeof(data)) );
-#else
if ( write(_tcp, cmd, size) != (int)size )
return false;
@@ -624,7 +588,6 @@ bool rfspace_source_c::transaction( const unsigned char *cmd, size_t size,
return false;
rx_bytes = 2 + length; /* header + payload */
-#endif
}
response.resize( rx_bytes );
@@ -829,7 +792,7 @@ int rfspace_source_c::work( int noutput_items,
{
gr_complex *out = (gr_complex *)output_items[0];
- boost::unique_lock<boost::mutex> lock(_fifo_lock);
+ std::unique_lock<std::mutex> lock(_fifo_lock);
/* Wait until we have the requested number of samples */
int n_samples_avail = _fifo->size();
@@ -852,10 +815,6 @@ int rfspace_source_c::work( int noutput_items,
return noutput_items;
}
-#ifdef USE_ASIO
- udp::endpoint ep;
- size_t rx_bytes = _u.receive_from( boost::asio::buffer(data, sizeof(data)), ep );
-#else
struct sockaddr_in sa_in; /* remote address */
socklen_t addrlen = sizeof(sa_in); /* length of addresses */
ssize_t rx_bytes = recvfrom(_udp, data, sizeof(data), 0, (struct sockaddr *)&sa_in, &addrlen);
@@ -864,7 +823,6 @@ int rfspace_source_c::work( int noutput_items,
std::cerr << "recvfrom returned " << rx_bytes << std::endl;
return WORK_DONE;
}
-#endif
#define HEADER_SIZE 2
#define SEQNUM_SIZE 2
@@ -892,11 +850,7 @@ int rfspace_source_c::work( int noutput_items,
if ( diff > 1 )
{
std::cerr << "Lost " << diff << " packets from "
-#ifdef USE_ASIO
- << ep
-#else
<< inet_ntoa(sa_in.sin_addr) << ":" << ntohs(sa_in.sin_port)
-#endif
<< std::endl;
}
@@ -977,48 +931,11 @@ typedef struct
uint16_t port;
} unit_t;
-#ifdef USE_ASIO
-static void handle_receive( const boost::system::error_code& ec,
- std::size_t length,
- boost::system::error_code* out_ec,
- std::size_t* out_length )
-{
- *out_ec = ec;
- *out_length = length;
-}
-
-static void handle_timer( const boost::system::error_code& ec,
- boost::system::error_code* out_ec )
-{
- *out_ec = boost::asio::error::timed_out;
-}
-#endif
static std::vector < unit_t > discover_netsdr()
{
std::vector < unit_t > units;
-#ifdef USE_ASIO
- boost::system::error_code ec;
- boost::asio::io_service ios;
- udp::socket socket(ios);
- deadline_timer timer(ios);
-
- timer.expires_at(boost::posix_time::pos_infin);
-
- socket.open(udp::v4(), ec);
-
- if ( ec )
- return units;
-
- socket.bind(udp::endpoint(udp::v4(), DISCOVER_CLIENT_PORT), ec);
-
- if ( ec )
- return units;
-
- socket.set_option(udp::socket::reuse_address(true));
- socket.set_option(boost::asio::socket_base::broadcast(true));
-#else
int sock;
if ( (sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0 )
@@ -1058,7 +975,6 @@ static std::vector < unit_t > discover_netsdr()
close(sock);
return units;
}
-#endif
discover_common_msg_t tx_msg;
memset( (void *)&tx_msg, 0, sizeof(discover_common_msg_t) );
@@ -1067,64 +983,18 @@ static std::vector < unit_t > discover_netsdr()
tx_msg.key[0] = KEY0;
tx_msg.key[1] = KEY1;
tx_msg.op = MSG_REQ;
-#ifdef USE_ASIO
- udp::endpoint ep(boost::asio::ip::address_v4::broadcast(), DISCOVER_SERVER_PORT);
- socket.send_to(boost::asio::buffer(&tx_msg, sizeof(tx_msg)), ep);
-#else
sendto(sock, &tx_msg, sizeof(tx_msg), 0, (struct sockaddr *)&peer_sa, sizeof(peer_sa));
-#endif
while ( true )
{
std::size_t rx_bytes = 0;
unsigned char data[1024*2];
-#ifdef USE_ASIO
- // Set up the variables that receive the result of the asynchronous
- // operation. The error code is set to would_block to signal that the
- // operation is incomplete. Asio guarantees that its asynchronous
- // operations will never fail with would_block, so any other value in
- // ec indicates completion.
- ec = boost::asio::error::would_block;
-
- // Start the asynchronous receive operation. The handle_receive function
- // used as a callback will update the ec and rx_bytes variables.
- socket.async_receive( boost::asio::buffer(data, sizeof(data)),
- boost::bind(handle_receive, _1, _2, &ec, &rx_bytes) );
-
- // Set a deadline for the asynchronous operation.
- timer.expires_from_now( boost::posix_time::milliseconds(10) );
-
- // Start an asynchronous wait on the timer. The handle_timer function
- // used as a callback will update the ec variable.
- timer.async_wait( boost::bind(handle_timer, _1, &ec) );
-
- // Reset the io_service in preparation for a subsequent run_one() invocation.
- ios.reset();
-
- // Block until at least one asynchronous operation has completed.
- do ios.run_one(); while ( ec == boost::asio::error::would_block );
-
- if ( boost::asio::error::timed_out == ec ) /* timer was first to complete */
- {
- // Please note that cancel() has portability issues on some versions of
- // Microsoft Windows, and it may be necessary to use close() instead.
- // Consult the documentation for cancel() for further information.
- socket.cancel();
-
- break;
- }
- else /* socket was first to complete */
- {
- timer.cancel();
- }
-#else
socklen_t addrlen = sizeof(peer_sa); /* length of addresses */
int nbytes = recvfrom(sock, data, sizeof(data), 0, (struct sockaddr *)&peer_sa, &addrlen);
if ( nbytes <= 0 )
break;
rx_bytes = nbytes;
-#endif
if ( rx_bytes >= sizeof(discover_common_msg_t) )
{
@@ -1151,11 +1021,7 @@ static std::vector < unit_t > discover_netsdr()
}
}
}
-#ifdef USE_ASIO
- socket.close(ec);
-#else
close(sock);
-#endif
return units;
}
@@ -1296,7 +1162,7 @@ std::vector<std::string> rfspace_source_c::get_devices( bool fake )
std::vector < unit_t > units = discover_netsdr();
- BOOST_FOREACH( unit_t u, units )
+ for (unit_t u : units)
{
// std::cerr << u.name << " " << u.sn << " " << u.addr << ":" << u.port
// << std::endl;
@@ -1310,7 +1176,7 @@ std::vector<std::string> rfspace_source_c::get_devices( bool fake )
units = discover_sdr_iq();
- BOOST_FOREACH( unit_t u, units )
+ for (unit_t u : units)
{
// std::cerr << u.name << " " << u.sn << " " << u.addr << ":" << u.port
// << std::endl;
@@ -1411,6 +1277,21 @@ osmosdr::meta_range_t rfspace_source_c::get_sample_rates()
range += osmosdr::range_t( 1228800 );
range += osmosdr::range_t( 1807058 );
}
+ else if ( RFSPACE_CLOUDSDR == _radio )
+ {
+ /* CloudSDR supports 122.88 MHz / 4*N for N = 15 ... 2560, but lets limit
+ * ourselves to the ones available in SpectraVue
+ */
+ range += osmosdr::range_t( 48000 ); // 40 kHz
+ range += osmosdr::range_t( 61440 ); // 50 kHz
+ range += osmosdr::range_t( 122880 ); // 100 kHz
+ range += osmosdr::range_t( 245760 ); // 200 kHz
+ range += osmosdr::range_t( 370120 ); // 300 kHz
+ range += osmosdr::range_t( 495483 ); // 400 kHz
+ range += osmosdr::range_t( 614400 ); // 500 kHz
+ range += osmosdr::range_t( 1228800 ); // 1 MHz
+ range += osmosdr::range_t( 2048000 ); // 2 MHz (16 bit)
+ }
return range;
}
@@ -1708,7 +1589,8 @@ std::string rfspace_source_c::get_antenna( size_t chan )
double rfspace_source_c::set_bandwidth( double bandwidth, size_t chan )
{
if ( RFSPACE_SDR_IQ == _radio ||
- RFSPACE_CLOUDIQ == _radio) /* not supported by SDR-IQ or Cloud-IQ */
+ RFSPACE_CLOUDIQ == _radio ||
+ RFSPACE_CLOUDSDR == _radio) /* not supported by SDR-IQ, Cloud-IQ, or CloudSDR */
return 0.0f;
/* SDR-IP 4.2.5 RF Filter Selection */
diff --git a/lib/rfspace/rfspace_source_c.h b/lib/rfspace/rfspace_source_c.h
index c656063..8bd2f11 100644
--- a/lib/rfspace/rfspace_source_c.h
+++ b/lib/rfspace/rfspace_source_c.h
@@ -20,25 +20,17 @@
#ifndef INCLUDED_RFSPACE_SOURCE_C_H
#define INCLUDED_RFSPACE_SOURCE_C_H
-//#define USE_ASIO
-
-#ifdef USE_ASIO
-#include <boost/asio.hpp>
-#endif
#include <gnuradio/thread/thread.h>
#include <gnuradio/block.h>
#include <gnuradio/sync_block.h>
#include <boost/circular_buffer.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+
+#include <mutex>
+#include <condition_variable>
#include "osmosdr/ranges.h"
#include "source_iface.h"
-#ifdef USE_ASIO
-using boost::asio::ip::tcp;
-using boost::asio::ip::udp;
-#endif
class rfspace_source_c;
#ifndef SOCKET
@@ -46,7 +38,7 @@ class rfspace_source_c;
#endif
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -54,9 +46,9 @@ class rfspace_source_c;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<rfspace_source_c> rfspace_source_c_sptr;
+typedef std::shared_ptr<rfspace_source_c> rfspace_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of rfspace_source_c.
@@ -138,20 +130,14 @@ private: /* members */
RFSPACE_SDR_IQ,
RFSPACE_SDR_IP,
RFSPACE_NETSDR,
- RFSPACE_CLOUDIQ
+ RFSPACE_CLOUDIQ,
+ RFSPACE_CLOUDSDR
};
radio_type _radio;
-#ifdef USE_ASIO
- boost::asio::io_service _io_service;
- tcp::resolver _resolver;
- tcp::socket _t;
- udp::socket _u;
-#else
SOCKET _tcp;
SOCKET _udp;
-#endif
int _usb;
bool _running;
bool _keep_running;
@@ -164,15 +150,15 @@ private: /* members */
gr::thread::thread _thread;
bool _run_usb_read_task;
bool _run_tcp_keepalive_task;
- boost::mutex _tcp_lock;
+ std::mutex _tcp_lock;
boost::circular_buffer<gr_complex> *_fifo;
- boost::mutex _fifo_lock;
- boost::condition_variable _samp_avail;
+ std::mutex _fifo_lock;
+ std::condition_variable _samp_avail;
std::vector< unsigned char > _resp;
- boost::mutex _resp_lock;
- boost::condition_variable _resp_avail;
+ std::mutex _resp_lock;
+ std::condition_variable _resp_avail;
};
#endif /* INCLUDED_RFSPACE_SOURCE_C_H */
diff --git a/lib/rtl/CMakeLists.txt b/lib/rtl/CMakeLists.txt
index f438df5..443f3c0 100644
--- a/lib/rtl/CMakeLists.txt
+++ b/lib/rtl/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,18 +21,16 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${LIBRTLSDR_INCLUDE_DIRS}
)
-set(rtl_srcs
- ${CMAKE_CURRENT_SOURCE_DIR}/rtl_source_c.cc
+APPEND_LIB_LIST(
+ ${LIBRTLSDR_LIBRARIES}
)
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${rtl_srcs})
-list(APPEND gr_osmosdr_libs ${LIBRTLSDR_LIBRARIES})
-
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/rtl_source_c.cc
+)
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/rtl/rtl_source_c.cc b/lib/rtl/rtl_source_c.cc
index a371464..644bf7a 100644
--- a/lib/rtl/rtl_source_c.cc
+++ b/lib/rtl/rtl_source_c.cc
@@ -32,7 +32,6 @@
#include <boost/assign.hpp>
#include <boost/format.hpp>
-#include <boost/detail/endian.hpp>
#include <boost/algorithm/string.hpp>
#include <stdexcept>
@@ -298,7 +297,7 @@ void rtl_source_c::rtlsdr_callback(unsigned char *buf, uint32_t len)
}
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock( _buf_mutex );
int buf_tail = (_buf_head + _buf_used) % _buf_num;
memcpy(_buf[buf_tail], buf, len);
@@ -338,7 +337,7 @@ int rtl_source_c::work( int noutput_items,
gr_complex *out = (gr_complex *)output_items[0];
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::unique_lock<std::mutex> lock( _buf_mutex );
while (_buf_used < 3 && _running) // collect at least 3 buffers
_buf_cond.wait( lock );
@@ -359,7 +358,7 @@ int rtl_source_c::work( int noutput_items,
if (!_samp_avail) {
{
- boost::mutex::scoped_lock lock( _buf_mutex );
+ std::lock_guard<std::mutex> lock( _buf_mutex );
_buf_head = (_buf_head + 1) % _buf_num;
_buf_used--;
@@ -456,6 +455,8 @@ double rtl_source_c::get_sample_rate()
osmosdr::freq_range_t rtl_source_c::get_freq_range( size_t chan )
{
osmosdr::freq_range_t range;
+ char manufact[256];
+ char product[256];
if (_dev) {
if (_no_tuner) {
@@ -465,6 +466,8 @@ osmosdr::freq_range_t rtl_source_c::get_freq_range( size_t chan )
return range;
}
+ rtlsdr_get_usb_strings( _dev, manufact, product, NULL );
+
enum rtlsdr_tuner tuner = rtlsdr_get_tuner_type(_dev);
if ( tuner == RTLSDR_TUNER_E4000 ) {
@@ -479,6 +482,8 @@ osmosdr::freq_range_t rtl_source_c::get_freq_range( size_t chan )
range += osmosdr::range_t( 438e6, 924e6 );
} else if ( tuner == RTLSDR_TUNER_R820T ) {
range += osmosdr::range_t( 24e6, 1766e6 );
+ } else if ( tuner == RTLSDR_TUNER_R828D && strcmp(manufact, "RTLSDRBlog") == 0 && strcmp(product, "Blog V4") == 0 ) {
+ range += osmosdr::range_t( 0e6, 1766e6 );
} else if ( tuner == RTLSDR_TUNER_R828D ) {
range += osmosdr::range_t( 24e6, 1766e6 );
}
diff --git a/lib/rtl/rtl_source_c.h b/lib/rtl/rtl_source_c.h
index 902b386..99f14f4 100644
--- a/lib/rtl/rtl_source_c.h
+++ b/lib/rtl/rtl_source_c.h
@@ -25,8 +25,9 @@
#include <gnuradio/sync_block.h>
#include <gnuradio/thread/thread.h>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+
+#include <mutex>
+#include <condition_variable>
#include "source_iface.h"
@@ -34,7 +35,7 @@ class rtl_source_c;
typedef struct rtlsdr_dev rtlsdr_dev_t;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr::blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -42,9 +43,9 @@ typedef struct rtlsdr_dev rtlsdr_dev_t;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<rtl_source_c> rtl_source_c_sptr;
+typedef std::shared_ptr<rtl_source_c> rtl_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of rtl_source_c.
@@ -131,8 +132,8 @@ private:
unsigned int _buf_len;
unsigned int _buf_head;
unsigned int _buf_used;
- boost::mutex _buf_mutex;
- boost::condition_variable _buf_cond;
+ std::mutex _buf_mutex;
+ std::condition_variable _buf_cond;
bool _running;
unsigned int _buf_offset;
diff --git a/lib/rtl_tcp/CMakeLists.txt b/lib/rtl_tcp/CMakeLists.txt
index 9f7c201..e5477d9 100644
--- a/lib/rtl_tcp/CMakeLists.txt
+++ b/lib/rtl_tcp/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,17 +21,21 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
-set(rtl_tcp_srcs
- ${CMAKE_CURRENT_SOURCE_DIR}/rtl_tcp_source_c.cc
+APPEND_LIB_LIST(
+ ${Gnuradio-blocks_LIBRARIES}
)
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${rtl_tcp_srcs})
-#list(APPEND gr_osmosdr_libs ${GNURADIO_BLOCKS_LIBRARIES})
+if(WIN32)
+ APPEND_LIB_LIST(
+ ws2_32
+ )
+endif()
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/rtl_tcp_source_c.cc
+)
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/rtl_tcp/rtl_tcp_source_c.cc b/lib/rtl_tcp/rtl_tcp_source_c.cc
index ecdeee0..a958335 100644
--- a/lib/rtl_tcp/rtl_tcp_source_c.cc
+++ b/lib/rtl_tcp/rtl_tcp_source_c.cc
@@ -32,7 +32,6 @@
#if defined(_WIN32)
// if not posix, assume winsock
-#pragma comment(lib, "ws2_32.lib")
#define USING_WINSOCK
#include <winsock2.h>
#include <ws2tcpip.h>
@@ -89,7 +88,9 @@ static int is_error( int perr )
{
// Compare error to posix error code; return nonzero if match.
#if defined(USING_WINSOCK)
+#ifndef ENOPROTOOPT
#define ENOPROTOOPT 109
+#endif
// All codes to be checked for must be defined below
int werr = WSAGetLastError();
switch( werr ) {
@@ -98,7 +99,7 @@ static int is_error( int perr )
case WSAENOPROTOOPT:
return( perr == ENOPROTOOPT );
default:
- fprintf(stderr,"rtl_tcp_source_f: unknown error %d WS err %d \n", perr, werr );
+ fprintf(stderr,"rtl_tcp_source_c: unknown error %d WS err %d \n", perr, werr );
throw std::runtime_error("internal error");
}
return 0;
@@ -200,7 +201,7 @@ rtl_tcp_source_c::rtl_tcp_source_c(const std::string &args) :
WSADATA wsaData;
int iResult = WSAStartup( MAKEWORD(2,2), &wsaData );
if( iResult != NO_ERROR ) {
- report_error( "rtl_tcp_source_f WSAStartup", "can't open socket" );
+ report_error( "rtl_tcp_source_c WSAStartup", "can't open socket" );
}
#endif
@@ -219,7 +220,7 @@ rtl_tcp_source_c::rtl_tcp_source_c(const std::string &args) :
// FIXME leaks if report_error throws below
int ret = getaddrinfo(host.c_str(), port_str, &hints, &ip_src);
if (ret != 0)
- report_error("rtl_tcp_source_f/getaddrinfo",
+ report_error("rtl_tcp_source_c/getaddrinfo",
"can't initialize source socket" );
d_temp_buff = new unsigned char[payload_size]; // allow it to hold up to payload_size bytes
@@ -261,8 +262,8 @@ rtl_tcp_source_c::rtl_tcp_source_c(const std::string &args) :
report_error("SO_RCVTIMEO","can't set socket option SO_RCVTIMEO");
#endif // USE_RCV_TIMEO
- while (::connect(d_socket, ip_src->ai_addr, ip_src->ai_addrlen) != 0)
- ; // FIXME handle errors?
+ if (::connect(d_socket, ip_src->ai_addr, ip_src->ai_addrlen) != 0)
+ report_error("rtl_tcp_source_c/connect","can't open TCP connection");
freeaddrinfo(ip_src);
int flag = 1;
diff --git a/lib/rtl_tcp/rtl_tcp_source_c.h b/lib/rtl_tcp/rtl_tcp_source_c.h
index b07e5dd..2c11018 100644
--- a/lib/rtl_tcp/rtl_tcp_source_c.h
+++ b/lib/rtl_tcp/rtl_tcp_source_c.h
@@ -26,7 +26,7 @@
class rtl_tcp_source_c;
-typedef boost::shared_ptr< rtl_tcp_source_c > rtl_tcp_source_c_sptr;
+typedef std::shared_ptr< rtl_tcp_source_c > rtl_tcp_source_c_sptr;
rtl_tcp_source_c_sptr make_rtl_tcp_source_c( const std::string & args = "" );
diff --git a/lib/rtl_tcp/rtl_tcp_source_f.cc b/lib/rtl_tcp/rtl_tcp_source_f.cc
deleted file mode 100644
index a17594c..0000000
--- a/lib/rtl_tcp/rtl_tcp_source_f.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2012 Hoernchen <la@tfc-server.de>
- * Copyright 2012 Dimitri Stolnikov <horiz0n@gmx.net>
- *
- * GNU Radio 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, or (at your option)
- * any later version.
- *
- * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-//#define HAVE_WINDOWS_H
-
-
-#include <rtl_tcp_source_f.h>
-#include <gnuradio/io_signature.h>
-#include <stdexcept>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifndef _WIN32
-#include <netinet/in.h>
-#else
-#include <WinSock2.h>
-#endif
-
-/* copied from rtl sdr code */
-typedef struct { /* structure size must be multiple of 2 bytes */
- char magic[4];
- uint32_t tuner_type;
- uint32_t tuner_gain_count;
-} dongle_info_t;
-
-#define USE_SELECT 1 // non-blocking receive on all platforms
-#define USE_RCV_TIMEO 0 // non-blocking receive on all but Cygwin
-#define SRC_VERBOSE 0
-#define SNK_VERBOSE 0
-
-static int is_error( int perr )
-{
- // Compare error to posix error code; return nonzero if match.
-#if defined(USING_WINSOCK)
-#define ENOPROTOOPT 109
- // All codes to be checked for must be defined below
- int werr = WSAGetLastError();
- switch( werr ) {
- case WSAETIMEDOUT:
- return( perr == EAGAIN );
- case WSAENOPROTOOPT:
- return( perr == ENOPROTOOPT );
- default:
- fprintf(stderr,"rtl_tcp_source_f: unknown error %d WS err %d \n", perr, werr );
- throw std::runtime_error("internal error");
- }
- return 0;
-#else
- return( perr == errno );
-#endif
-}
-
-static void report_error( const char *msg1, const char *msg2 )
-{
- // Deal with errors, both posix and winsock
-#if defined(USING_WINSOCK)
- int werr = WSAGetLastError();
- fprintf(stderr, "%s: winsock error %d\n", msg1, werr );
-#else
- perror(msg1);
-#endif
- if( msg2 != NULL )
- throw std::runtime_error(msg2);
- return;
-}
-
-rtl_tcp_source_f::rtl_tcp_source_f(size_t itemsize,
- const char *host,
- unsigned short port,
- int payload_size,
- bool eof,
- bool wait)
- : gr::sync_block ("rtl_tcp_source_f",
- gr::io_signature::make(0, 0, 0),
- gr::io_signature::make(1, 1, sizeof(float))),
- d_itemsize(itemsize),
- d_payload_size(payload_size),
- d_eof(eof),
- d_wait(wait),
- d_socket(-1),
- d_temp_offset(0)
-{
- int ret = 0;
-#if defined(USING_WINSOCK) // for Windows (with MinGW)
- // initialize winsock DLL
- WSADATA wsaData;
- int iResult = WSAStartup( MAKEWORD(2,2), &wsaData );
- if( iResult != NO_ERROR ) {
- report_error( "rtl_tcp_source_f WSAStartup", "can't open socket" );
- }
-#endif
-
- // Set up the address stucture for the source address and port numbers
- // Get the source IP address from the host name
- struct addrinfo *ip_src; // store the source IP address to use
- struct addrinfo hints;
- memset( (void*)&hints, 0, sizeof(hints) );
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_protocol = IPPROTO_TCP;
- hints.ai_flags = AI_PASSIVE;
- char port_str[12];
- sprintf( port_str, "%d", port );
-
- // FIXME leaks if report_error throws below
- ret = getaddrinfo( host, port_str, &hints, &ip_src );
- if( ret != 0 )
- report_error("rtl_tcp_source_f/getaddrinfo",
- "can't initialize source socket" );
-
- // FIXME leaks if report_error throws below
- d_temp_buff = new unsigned char[d_payload_size]; // allow it to hold up to payload_size bytes
- d_LUT= new float[0xff+1];
- for(int i=0; i <=(0xff);++i){
- d_LUT[i] = (((float)(i&0xff))-127.4f)*(1.0f/128.0f);
- }
- // create socket
- d_socket = socket(ip_src->ai_family, ip_src->ai_socktype,
- ip_src->ai_protocol);
- if(d_socket == -1) {
- report_error("socket open","can't open socket");
- }
-
- // Turn on reuse address
- int opt_val = 1;
- if(setsockopt(d_socket, SOL_SOCKET, SO_REUSEADDR, (optval_t)&opt_val, sizeof(int)) == -1) {
- report_error("SO_REUSEADDR","can't set socket option SO_REUSEADDR");
- }
-
- // Don't wait when shutting down
- linger lngr;
- lngr.l_onoff = 1;
- lngr.l_linger = 0;
- if(setsockopt(d_socket, SOL_SOCKET, SO_LINGER, (optval_t)&lngr, sizeof(linger)) == -1) {
- if( !is_error(ENOPROTOOPT) ) { // no SO_LINGER for SOCK_DGRAM on Windows
- report_error("SO_LINGER","can't set socket option SO_LINGER");
- }
- }
-
-#if USE_RCV_TIMEO
- // Set a timeout on the receive function to not block indefinitely
- // This value can (and probably should) be changed
- // Ignored on Cygwin
-#if defined(USING_WINSOCK)
- DWORD timeout = 1000; // milliseconds
-#else
- timeval timeout;
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-#endif
- if(setsockopt(d_socket, SOL_SOCKET, SO_RCVTIMEO, (optval_t)&timeout, sizeof(timeout)) == -1) {
- report_error("SO_RCVTIMEO","can't set socket option SO_RCVTIMEO");
- }
-#endif // USE_RCV_TIMEO
-
- while(connect(d_socket, ip_src->ai_addr, ip_src->ai_addrlen) != 0);
- freeaddrinfo(ip_src);
-
- int flag = 1;
- setsockopt(d_socket, IPPROTO_TCP, TCP_NODELAY, (char *)&flag,sizeof(flag));
-
- dongle_info_t dongle_info;
- ret = recv(d_socket, (char*)&dongle_info, sizeof(dongle_info), 0);
- if (sizeof(dongle_info) != ret)
- fprintf(stderr,"failed to read dongle info\n");
-
- d_tuner_type = RTLSDR_TUNER_UNKNOWN;
- d_tuner_gain_count = 0;
- d_tuner_if_gain_count = 0;
-
- if (memcmp(dongle_info.magic, "RTL0", 4) == 0)
- {
- d_tuner_type = ntohl(dongle_info.tuner_type);
- d_tuner_gain_count = ntohl(dongle_info.tuner_gain_count);
- if ( RTLSDR_TUNER_E4000 == d_tuner_type )
- d_tuner_if_gain_count = 53;
- }
-}
-
-rtl_tcp_source_f_sptr make_rtl_tcp_source_f (size_t itemsize,
- const char *ipaddr,
- unsigned short port,
- int payload_size,
- bool eof,
- bool wait)
-{
- return gnuradio::get_initial_sptr(new rtl_tcp_source_f (
- itemsize,
- ipaddr,
- port,
- payload_size,
- eof,
- wait));
-}
-
-rtl_tcp_source_f::~rtl_tcp_source_f ()
-{
- delete [] d_temp_buff;
-
- if (d_socket != -1){
- shutdown(d_socket, SHUT_RDWR);
-#if defined(USING_WINSOCK)
- closesocket(d_socket);
-#else
- ::close(d_socket);
-#endif
- d_socket = -1;
- }
-
-#if defined(USING_WINSOCK) // for Windows (with MinGW)
- // free winsock resources
- WSACleanup();
-#endif
-}
-
-int rtl_tcp_source_f::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- float *out = (float *) output_items[0];
- ssize_t r = 0;
-
- int bytesleft = noutput_items;
- int index = 0;
- int receivedbytes = 0;
- while(bytesleft > 0) {
- receivedbytes = recv(d_socket, (char*)&d_temp_buff[index], bytesleft, 0);
-
- if(receivedbytes == -1 && !is_error(EAGAIN)){
- fprintf(stderr, "socket error\n");
- return -1;
- }
- bytesleft -= receivedbytes;
- index += receivedbytes;
- }
- r = noutput_items;
-
- for(int i=0; i<r; ++i)
- out[i]=d_LUT[*(d_temp_buff+d_temp_offset+i)];
-
- return r;
-}
-
-#ifdef _WIN32
-#define __attribute__(x)
-#pragma pack(push, 1)
-#endif
-struct command{
- unsigned char cmd;
- unsigned int param;
-}__attribute__((packed));
-#ifdef _WIN32
-#pragma pack(pop)
-#endif
-
-void rtl_tcp_source_f::set_freq(int freq)
-{
- struct command cmd = { 0x01, htonl(freq) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_sample_rate(int sample_rate)
-{
- struct command cmd = { 0x02, htonl(sample_rate) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_gain_mode(int manual)
-{
- struct command cmd = { 0x03, htonl(manual) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_gain(int gain)
-{
- struct command cmd = { 0x04, htonl(gain) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_freq_corr(int ppm)
-{
- struct command cmd = { 0x05, htonl(ppm) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_if_gain(int stage, int gain)
-{
- uint32_t params = stage << 16 | (gain & 0xffff);
- struct command cmd = { 0x06, htonl(params) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_agc_mode(int on)
-{
- struct command cmd = { 0x08, htonl(on) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_direct_sampling(int on)
-{
- struct command cmd = { 0x09, htonl(on) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
-
-void rtl_tcp_source_f::set_offset_tuning(int on)
-{
- struct command cmd = { 0x0a, htonl(on) };
- send(d_socket, (const char*)&cmd, sizeof(cmd), 0);
-}
diff --git a/lib/rtl_tcp/rtl_tcp_source_f.h b/lib/rtl_tcp/rtl_tcp_source_f.h
deleted file mode 100644
index 84ac57a..0000000
--- a/lib/rtl_tcp/rtl_tcp_source_f.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2012 Hoernchen <la@tfc-server.de>
- *
- * GNU Radio 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, or (at your option)
- * any later version.
- *
- * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef RTL_TCP_SOURCE_F_H
-#define RTL_TCP_SOURCE_F_H
-
-#include <gnuradio/sync_block.h>
-#include <gnuradio/thread/thread.h>
-
-#if defined(_WIN32)
-// if not posix, assume winsock
-#pragma comment(lib, "ws2_32.lib")
-#define USING_WINSOCK
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#define SHUT_RDWR 2
-typedef char* optval_t;
-#else
-#include <netdb.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-typedef void* optval_t;
-#endif
-
-#ifdef _MSC_VER
-#include <cstddef>
-typedef ptrdiff_t ssize_t;
-#endif //_MSC_VER
-
-/* copied from rtl sdr */
-enum rtlsdr_tuner {
- RTLSDR_TUNER_UNKNOWN = 0,
- RTLSDR_TUNER_E4000,
- RTLSDR_TUNER_FC0012,
- RTLSDR_TUNER_FC0013,
- RTLSDR_TUNER_FC2580,
- RTLSDR_TUNER_R820T,
- RTLSDR_TUNER_R828D
-};
-
-class rtl_tcp_source_f;
-typedef boost::shared_ptr<rtl_tcp_source_f> rtl_tcp_source_f_sptr;
-
-rtl_tcp_source_f_sptr make_rtl_tcp_source_f (
- size_t itemsize,
- const char *host,
- unsigned short port,
- int payload_size,
- bool eof = false,
- bool wait = false);
-
-class rtl_tcp_source_f : public gr::sync_block
-{
-private:
- size_t d_itemsize;
- int d_payload_size; // maximum transmission unit (packet length)
- bool d_eof; // zero-length packet is EOF
- bool d_wait; // wait if data if not immediately available
- int d_socket; // handle to socket
- unsigned char *d_temp_buff; // hold buffer between calls
- size_t d_temp_offset; // point to temp buffer location offset
- float *d_LUT;
-
- unsigned int d_tuner_type;
- unsigned int d_tuner_gain_count;
- unsigned int d_tuner_if_gain_count;
-
-private:
- rtl_tcp_source_f(size_t itemsize, const char *host,
- unsigned short port, int payload_size, bool eof, bool wait);
-
- // The friend declaration allows make_source_c to
- // access the private constructor.
- friend rtl_tcp_source_f_sptr make_rtl_tcp_source_f (
- size_t itemsize,
- const char *host,
- unsigned short port,
- int payload_size,
- bool eof,
- bool wait);
-
-public:
- ~rtl_tcp_source_f();
-
- enum rtlsdr_tuner get_tuner_type() { return (enum rtlsdr_tuner) d_tuner_type; }
- unsigned int get_tuner_gain_count() { return d_tuner_gain_count; }
- unsigned int get_tuner_if_gain_count() { return d_tuner_if_gain_count; }
-
- int work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-
- void set_freq(int freq);
- void set_sample_rate(int sample_rate);
- void set_gain_mode(int manual);
- void set_gain(int gain);
- void set_freq_corr(int ppm);
- void set_if_gain(int stage, int gain);
- void set_agc_mode(int on);
- void set_direct_sampling(int on);
- void set_offset_tuning(int on);
-};
-
-
-#endif /* RTL_TCP_SOURCE_F_H */
diff --git a/lib/sdrplay/CMakeLists.txt b/lib/sdrplay/CMakeLists.txt
index 382ab33..3d20a6f 100644
--- a/lib/sdrplay/CMakeLists.txt
+++ b/lib/sdrplay/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,17 +21,16 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${LIBSDRPLAY_INCLUDE_DIRS}
)
-set(sdrplay_srcs
- ${CMAKE_CURRENT_SOURCE_DIR}/sdrplay_source_c.cc
+APPEND_LIB_LIST(
+ ${LIBSDRPLAY_LIBRARIES}
)
-########################################################################
-# Append gnuradio-sdrplay library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${sdrplay_srcs})
-list(APPEND gr_osmosdr_libs ${LIBSDRPLAY_LIBRARIES})
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/sdrplay_source_c.cc
+)
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/sdrplay/sdrplay_source_c.h b/lib/sdrplay/sdrplay_source_c.h
index 2e4631e..9ea6cb9 100644
--- a/lib/sdrplay/sdrplay_source_c.h
+++ b/lib/sdrplay/sdrplay_source_c.h
@@ -24,8 +24,9 @@
#include <gnuradio/sync_block.h>
#include <gnuradio/thread/thread.h>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition_variable.hpp>
+
+#include <mutex>
+#include <condition_variable>
#include "osmosdr/ranges.h"
@@ -35,7 +36,7 @@ class sdrplay_source_c;
typedef struct sdrplay_dev sdrplay_dev_t;
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr::blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -43,9 +44,9 @@ typedef struct sdrplay_dev sdrplay_dev_t;
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<sdrplay_source_c> sdrplay_source_c_sptr;
+typedef std::shared_ptr<sdrplay_source_c> sdrplay_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of sdrplay_source_c.
@@ -126,7 +127,7 @@ private:
std::vector< short > _bufi;
std::vector< short > _bufq;
int _buf_offset;
- boost::mutex _buf_mutex;
+ std::mutex _buf_mutex;
bool _running;
bool _uninit;
diff --git a/lib/sink_iface.h b/lib/sink_iface.h
index 39aabc7..0d1b8e6 100644
--- a/lib/sink_iface.h
+++ b/lib/sink_iface.h
@@ -32,6 +32,8 @@
class sink_iface
{
public:
+ virtual ~sink_iface() = default;
+
/*!
* Get the number of channels the underlying radio hardware offers.
* \return the number of available channels
@@ -201,6 +203,7 @@ public:
/*!
* Select the active antenna of the underlying radio hardware.
+ * \param antenna the antenna name
* \param chan the channel index 0 to N-1
* \return the actual antenna's name
*/
diff --git a/lib/sink_impl.cc b/lib/sink_impl.cc
index 877b31f..68ad7f3 100644
--- a/lib/sink_impl.cc
+++ b/lib/sink_impl.cc
@@ -48,6 +48,9 @@
#ifdef ENABLE_FREESRP
#include <freesrp_sink_c.h>
#endif
+#ifdef ENABLE_XTRX
+#include "xtrx_sink_c.h"
+#endif
#ifdef ENABLE_FILE
#include "file_sink_c.h"
#endif
@@ -99,6 +102,9 @@ sink_impl::sink_impl( const std::string &args )
#ifdef ENABLE_FREESRP
dev_types.push_back("freesrp");
#endif
+#ifdef ENABLE_XTRX
+ dev_types.push_back("xtrx");
+#endif
#ifdef ENABLE_FILE
dev_types.push_back("file");
#endif
@@ -107,13 +113,13 @@ sink_impl::sink_impl( const std::string &args )
<< GR_OSMOSDR_VERSION << " (" << GR_OSMOSDR_LIBVER << ") "
<< "gnuradio " << gr::version() << std::endl;
std::cerr << "built-in sink types: ";
- BOOST_FOREACH(std::string dev_type, dev_types)
+ for (std::string dev_type : dev_types)
std::cerr << dev_type << " ";
std::cerr << std::endl;
- BOOST_FOREACH(std::string arg, arg_list) {
+ for (std::string arg : arg_list) {
dict_t dict = params_to_dict(arg);
- BOOST_FOREACH(std::string dev_type, dev_types) {
+ for (std::string dev_type : dev_types) {
if ( dict.count( dev_type ) ) {
device_specified = true;
break;
@@ -124,36 +130,40 @@ sink_impl::sink_impl( const std::string &args )
if ( ! device_specified ) {
std::vector< std::string > dev_list;
#ifdef ENABLE_UHD
- BOOST_FOREACH( std::string dev, uhd_sink_c::get_devices() )
+ for (std::string dev : uhd_sink_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_BLADERF
- BOOST_FOREACH( std::string dev, bladerf_sink_c::get_devices() )
+ for (std::string dev : bladerf_sink_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_HACKRF
- BOOST_FOREACH( std::string dev, hackrf_sink_c::get_devices() )
+ for (std::string dev : hackrf_sink_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_SOAPY
- BOOST_FOREACH( std::string dev, soapy_sink_c::get_devices() )
+ for (std::string dev : soapy_sink_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_REDPITAYA
- BOOST_FOREACH( std::string dev, redpitaya_sink_c::get_devices() )
+ for (std::string dev : redpitaya_sink_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_FREESRP
- BOOST_FOREACH( std::string dev, freesrp_sink_c::get_devices() )
+ for (std::string dev : freesrp_sink_c::get_devices())
+ dev_list.push_back( dev );
+#endif
+#ifdef ENABLE_XTRX
+ for (std::string dev : xtrx_sink_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_FILE
- BOOST_FOREACH( std::string dev, file_sink_c::get_devices() )
+ for (std::string dev : file_sink_c::get_devices())
dev_list.push_back( dev );
#endif
// std::cerr << std::endl;
-// BOOST_FOREACH( std::string dev, dev_list )
+// for (std::string dev : dev_list)
// std::cerr << "'" << dev << "'" << std::endl;
if ( dev_list.size() )
@@ -162,12 +172,12 @@ sink_impl::sink_impl( const std::string &args )
throw std::runtime_error("No supported devices found (check the connection and/or udev rules).");
}
- BOOST_FOREACH(std::string arg, arg_list) {
+ for (std::string arg : arg_list) {
dict_t dict = params_to_dict(arg);
// std::cerr << std::endl;
-// BOOST_FOREACH( dict_t::value_type &entry, dict )
+// for (dict_t::value_type &entry : dict)
// std::cerr << "'" << entry.first << "' = '" << entry.second << "'" << std::endl;
sink_iface *iface = NULL;
@@ -209,6 +219,12 @@ sink_impl::sink_impl( const std::string &args )
block = sink; iface = sink.get();
}
#endif
+#ifdef ENABLE_XTRX
+ if ( dict.count("xtrx") ) {
+ xtrx_sink_c_sptr sink = make_xtrx_sink_c( arg );
+ block = sink; iface = sink.get();
+ }
+#endif
#ifdef ENABLE_FILE
if ( dict.count("file") ) {
file_sink_c_sptr sink = make_file_sink_c( arg );
@@ -216,26 +232,33 @@ sink_impl::sink_impl( const std::string &args )
}
#endif
- if ( iface != NULL && long(block.get()) != 0 ) {
+ if (iface != NULL && reinterpret_cast<std::intptr_t>(block.get()) != 0) {
_devs.push_back( iface );
for (size_t i = 0; i < iface->get_num_channels(); i++) {
connect(self(), channel++, block, i);
}
- } else if ( (iface != NULL) || (long(block.get()) != 0) )
+ } else if ((iface != NULL) || (reinterpret_cast<std::intptr_t>(block.get()) != 0))
throw std::runtime_error("Either iface or block are NULL.");
}
if (!_devs.size())
throw std::runtime_error("No devices specified via device arguments.");
+
+ /* Populate the _gain and _gain_mode arrays with the hardware state */
+ for ( sink_iface *dev : _devs )
+ for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
+ _gain_mode[dev_chan] = dev->get_gain_mode(dev_chan);
+ _gain[dev_chan] = dev->get_gain(dev_chan);
+ }
}
size_t sink_impl::get_num_channels()
{
size_t channels = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
channels += dev->get_num_channels();
return channels;
@@ -263,13 +286,13 @@ double sink_impl::set_sample_rate(double rate)
if (_devs.empty())
throw std::runtime_error(NO_DEVICES_MSG);
#endif
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
sample_rate = dev->set_sample_rate(rate);
_sample_rate = sample_rate;
}
- return sample_rate;
+ return _sample_rate;
}
double sink_impl::get_sample_rate()
@@ -288,7 +311,7 @@ double sink_impl::get_sample_rate()
osmosdr::freq_range_t sink_impl::get_freq_range( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_freq_range( dev_chan );
@@ -299,7 +322,7 @@ osmosdr::freq_range_t sink_impl::get_freq_range( size_t chan )
double sink_impl::set_center_freq( double freq, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _center_freq[ chan ] != freq ) {
@@ -314,7 +337,7 @@ double sink_impl::set_center_freq( double freq, size_t chan )
double sink_impl::get_center_freq( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_center_freq( dev_chan );
@@ -325,7 +348,7 @@ double sink_impl::get_center_freq( size_t chan )
double sink_impl::set_freq_corr( double ppm, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _freq_corr[ chan ] != ppm ) {
@@ -340,7 +363,7 @@ double sink_impl::set_freq_corr( double ppm, size_t chan )
double sink_impl::get_freq_corr( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_freq_corr( dev_chan );
@@ -351,7 +374,7 @@ double sink_impl::get_freq_corr( size_t chan )
std::vector<std::string> sink_impl::get_gain_names( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_names( dev_chan );
@@ -362,7 +385,7 @@ std::vector<std::string> sink_impl::get_gain_names( size_t chan )
osmosdr::gain_range_t sink_impl::get_gain_range( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_range( dev_chan );
@@ -373,7 +396,7 @@ osmosdr::gain_range_t sink_impl::get_gain_range( size_t chan )
osmosdr::gain_range_t sink_impl::get_gain_range( const std::string & name, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_range( name, dev_chan );
@@ -384,10 +407,10 @@ osmosdr::gain_range_t sink_impl::get_gain_range( const std::string & name, size_
bool sink_impl::set_gain_mode( bool automatic, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
- if ( _gain_mode[ chan ] != automatic ) {
+ if ( (_gain_mode.count(chan) == 0) || (_gain_mode[ chan ] != automatic) ) {
_gain_mode[ chan ] = automatic;
bool mode = dev->set_gain_mode( automatic, dev_chan );
if (!automatic) // reapply gain value when switched to manual mode
@@ -402,7 +425,7 @@ bool sink_impl::set_gain_mode( bool automatic, size_t chan )
bool sink_impl::get_gain_mode( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_mode( dev_chan );
@@ -413,7 +436,7 @@ bool sink_impl::get_gain_mode( size_t chan )
double sink_impl::set_gain( double gain, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _gain[ chan ] != gain ) {
@@ -428,7 +451,7 @@ double sink_impl::set_gain( double gain, size_t chan )
double sink_impl::set_gain( double gain, const std::string & name, size_t chan)
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->set_gain( gain, name, dev_chan );
@@ -439,7 +462,7 @@ double sink_impl::set_gain( double gain, const std::string & name, size_t chan)
double sink_impl::get_gain( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain( dev_chan );
@@ -450,7 +473,7 @@ double sink_impl::get_gain( size_t chan )
double sink_impl::get_gain( const std::string & name, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain( name, dev_chan );
@@ -461,7 +484,7 @@ double sink_impl::get_gain( const std::string & name, size_t chan )
double sink_impl::set_if_gain( double gain, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _if_gain[ chan ] != gain ) {
@@ -476,7 +499,7 @@ double sink_impl::set_if_gain( double gain, size_t chan )
double sink_impl::set_bb_gain( double gain, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _bb_gain[ chan ] != gain ) {
@@ -491,7 +514,7 @@ double sink_impl::set_bb_gain( double gain, size_t chan )
std::vector< std::string > sink_impl::get_antennas( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_antennas( dev_chan );
@@ -502,7 +525,7 @@ std::vector< std::string > sink_impl::get_antennas( size_t chan )
std::string sink_impl::set_antenna( const std::string & antenna, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _antenna[ chan ] != antenna ) {
@@ -517,7 +540,7 @@ std::string sink_impl::set_antenna( const std::string & antenna, size_t chan )
std::string sink_impl::get_antenna( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_antenna( dev_chan );
@@ -528,7 +551,7 @@ std::string sink_impl::get_antenna( size_t chan )
void sink_impl::set_dc_offset( const std::complex<double> &offset, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
dev->set_dc_offset( offset, dev_chan );
@@ -537,7 +560,7 @@ void sink_impl::set_dc_offset( const std::complex<double> &offset, size_t chan )
void sink_impl::set_iq_balance( const std::complex<double> &balance, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
dev->set_iq_balance( balance, dev_chan );
@@ -546,7 +569,7 @@ void sink_impl::set_iq_balance( const std::complex<double> &balance, size_t chan
double sink_impl::set_bandwidth( double bandwidth, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _bandwidth[ chan ] != bandwidth || 0.0f == bandwidth ) {
@@ -561,7 +584,7 @@ double sink_impl::set_bandwidth( double bandwidth, size_t chan )
double sink_impl::get_bandwidth( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_bandwidth( dev_chan );
@@ -572,7 +595,7 @@ double sink_impl::get_bandwidth( size_t chan )
osmosdr::freq_range_t sink_impl::get_bandwidth_range( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_bandwidth_range( dev_chan );
@@ -665,7 +688,7 @@ void sink_impl::set_time_now(const osmosdr::time_spec_t &time_spec, size_t mboar
void sink_impl::set_time_next_pps(const osmosdr::time_spec_t &time_spec)
{
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
{
dev->set_time_next_pps( time_spec );
}
@@ -673,7 +696,7 @@ void sink_impl::set_time_next_pps(const osmosdr::time_spec_t &time_spec)
void sink_impl::set_time_unknown_pps(const osmosdr::time_spec_t &time_spec)
{
- BOOST_FOREACH( sink_iface *dev, _devs )
+ for (sink_iface *dev : _devs)
{
dev->set_time_unknown_pps( time_spec );
}
diff --git a/lib/soapy/CMakeLists.txt b/lib/soapy/CMakeLists.txt
index 338bcaf..7ac4d69 100644
--- a/lib/soapy/CMakeLists.txt
+++ b/lib/soapy/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2015 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,19 +21,18 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${SoapySDR_INCLUDE_DIRS}
)
-set(soapy_srcs
+APPEND_LIB_LIST(
+ ${SoapySDR_LIBRARIES}
+)
+
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/soapy_common.cc
${CMAKE_CURRENT_SOURCE_DIR}/soapy_source_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/soapy_sink_c.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${soapy_srcs})
-list(APPEND gr_osmosdr_libs ${SoapySDR_LIBRARIES})
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/soapy/soapy_common.cc b/lib/soapy/soapy_common.cc
index 0e277e4..e241967 100644
--- a/lib/soapy/soapy_common.cc
+++ b/lib/soapy/soapy_common.cc
@@ -36,8 +36,8 @@ osmosdr::gain_range_t soapy_range_to_gain_range(const SoapySDR::Range &r)
return osmosdr::gain_range_t(r.minimum(), r.maximum(), step);
}
-boost::mutex &get_soapy_maker_mutex(void)
+std::mutex &get_soapy_maker_mutex(void)
{
- static boost::mutex m;
+ static std::mutex m;
return m;
}
diff --git a/lib/soapy/soapy_common.h b/lib/soapy/soapy_common.h
index 87e46a5..8adb0db 100644
--- a/lib/soapy/soapy_common.h
+++ b/lib/soapy/soapy_common.h
@@ -23,7 +23,8 @@
#include <osmosdr/ranges.h>
#include <SoapySDR/Types.hpp>
-#include <boost/thread/mutex.hpp>
+
+#include <mutex>
/*!
* Convert a soapy range to a gain range.
@@ -35,6 +36,6 @@ osmosdr::gain_range_t soapy_range_to_gain_range(const SoapySDR::Range &r);
* Global mutex to protect factory routines.
* (optional under 0.5 release above)
*/
-boost::mutex &get_soapy_maker_mutex(void);
+std::mutex &get_soapy_maker_mutex(void);
#endif /* INCLUDED_SOAPY_COMMON_H */
diff --git a/lib/soapy/soapy_sink_c.cc b/lib/soapy/soapy_sink_c.cc
index b12b8da..4aafc47 100644
--- a/lib/soapy/soapy_sink_c.cc
+++ b/lib/soapy/soapy_sink_c.cc
@@ -63,7 +63,7 @@ soapy_sink_c::soapy_sink_c (const std::string &args)
gr::io_signature::make (0, 0, 0))
{
{
- boost::mutex::scoped_lock l(get_soapy_maker_mutex());
+ std::lock_guard<std::mutex> l(get_soapy_maker_mutex());
_device = SoapySDR::Device::make(params_to_dict(args));
}
_nchan = std::max(1, args_to_io_signature(args)->max_streams());
@@ -75,7 +75,7 @@ soapy_sink_c::soapy_sink_c (const std::string &args)
soapy_sink_c::~soapy_sink_c(void)
{
_device->closeStream(_stream);
- boost::mutex::scoped_lock l(get_soapy_maker_mutex());
+ std::lock_guard<std::mutex> l(get_soapy_maker_mutex());
SoapySDR::Device::unmake(_device);
}
@@ -107,7 +107,7 @@ std::vector<std::string> soapy_sink_c::get_devices()
{
std::vector<std::string> result;
int i = 0;
- BOOST_FOREACH(SoapySDR::Kwargs kw, SoapySDR::Device::enumerate())
+ for (SoapySDR::Kwargs kw : SoapySDR::Device::enumerate())
{
kw["soapy"] = boost::lexical_cast<std::string>(i++);
result.push_back(dict_to_args_string(kw));
@@ -124,12 +124,12 @@ osmosdr::meta_range_t soapy_sink_c::get_sample_rates( void )
{
osmosdr::meta_range_t result;
#ifdef SOAPY_SDR_API_HAS_GET_SAMPLE_RATE_RANGE
- BOOST_FOREACH(const SoapySDR::Range &r, _device->getSampleRateRange(SOAPY_SDR_TX, 0))
+ for (const SoapySDR::Range &r : _device->getSampleRateRange(SOAPY_SDR_TX, 0))
{
result.push_back(osmosdr::range_t(r.minimum(), r.maximum()));
}
#else
- BOOST_FOREACH(const double rate, _device->listSampleRates(SOAPY_SDR_TX, 0))
+ for (const double rate : _device->listSampleRates(SOAPY_SDR_TX, 0))
{
result.push_back(osmosdr::range_t(rate));
}
@@ -151,7 +151,7 @@ double soapy_sink_c::get_sample_rate( void )
osmosdr::freq_range_t soapy_sink_c::get_freq_range( size_t chan)
{
osmosdr::meta_range_t result;
- BOOST_FOREACH(const SoapySDR::Range r, _device->getFrequencyRange(SOAPY_SDR_TX, 0))
+ for (const SoapySDR::Range r : _device->getFrequencyRange(SOAPY_SDR_TX, 0))
{
result.push_back(osmosdr::range_t(r.minimum(), r.maximum()));
}
@@ -309,12 +309,12 @@ osmosdr::freq_range_t soapy_sink_c::get_bandwidth_range( size_t chan)
{
osmosdr::meta_range_t result;
#ifdef SOAPY_SDR_API_HAS_GET_BANDWIDTH_RANGE
- BOOST_FOREACH(const SoapySDR::Range &r, _device->getBandwidthRange(SOAPY_SDR_TX, 0))
+ for (const SoapySDR::Range &r : _device->getBandwidthRange(SOAPY_SDR_TX, 0))
{
result.push_back(osmosdr::range_t(r.minimum(), r.maximum()));
}
#else
- BOOST_FOREACH(const double bw, _device->listBandwidths(SOAPY_SDR_TX, 0))
+ for (const double bw : _device->listBandwidths(SOAPY_SDR_TX, 0))
{
result.push_back(osmosdr::range_t(bw));
}
diff --git a/lib/soapy/soapy_sink_c.h b/lib/soapy/soapy_sink_c.h
index 4900d15..514f954 100644
--- a/lib/soapy/soapy_sink_c.h
+++ b/lib/soapy/soapy_sink_c.h
@@ -36,7 +36,7 @@ namespace SoapySDR
}
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -44,9 +44,9 @@ namespace SoapySDR
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<soapy_sink_c> soapy_sink_c_sptr;
+typedef std::shared_ptr<soapy_sink_c> soapy_sink_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of soapy_sink_c.
diff --git a/lib/soapy/soapy_source_c.cc b/lib/soapy/soapy_source_c.cc
index a645361..4dc9efc 100644
--- a/lib/soapy/soapy_source_c.cc
+++ b/lib/soapy/soapy_source_c.cc
@@ -64,7 +64,7 @@ soapy_source_c::soapy_source_c (const std::string &args)
args_to_io_signature(args))
{
{
- boost::mutex::scoped_lock l(get_soapy_maker_mutex());
+ std::lock_guard<std::mutex> l(get_soapy_maker_mutex());
_device = SoapySDR::Device::make(params_to_dict(args));
}
_nchan = std::max(1, args_to_io_signature(args)->max_streams());
@@ -76,7 +76,7 @@ soapy_source_c::soapy_source_c (const std::string &args)
soapy_source_c::~soapy_source_c(void)
{
_device->closeStream(_stream);
- boost::mutex::scoped_lock l(get_soapy_maker_mutex());
+ std::lock_guard<std::mutex> l(get_soapy_maker_mutex());
SoapySDR::Device::unmake(_device);
}
@@ -96,9 +96,14 @@ int soapy_source_c::work( int noutput_items,
{
int flags = 0;
long long timeNs = 0;
- int ret = _device->readStream(
- _stream, &output_items[0],
- noutput_items, flags, timeNs);
+ int ret;
+ int retries = 1;
+
+ do {
+ ret = _device->readStream(
+ _stream, &output_items[0],
+ noutput_items, flags, timeNs);
+ } while (retries-- && (ret == SOAPY_SDR_OVERFLOW));
if (ret < 0) return 0; //call again
return ret;
@@ -108,7 +113,7 @@ std::vector<std::string> soapy_source_c::get_devices()
{
std::vector<std::string> result;
int i = 0;
- BOOST_FOREACH(SoapySDR::Kwargs kw, SoapySDR::Device::enumerate())
+ for (SoapySDR::Kwargs kw : SoapySDR::Device::enumerate())
{
kw["soapy"] = boost::lexical_cast<std::string>(i++);
result.push_back(dict_to_args_string(kw));
@@ -125,12 +130,12 @@ osmosdr::meta_range_t soapy_source_c::get_sample_rates( void )
{
osmosdr::meta_range_t result;
#ifdef SOAPY_SDR_API_HAS_GET_SAMPLE_RATE_RANGE
- BOOST_FOREACH(const SoapySDR::Range &r, _device->getSampleRateRange(SOAPY_SDR_RX, 0))
+ for (const SoapySDR::Range &r : _device->getSampleRateRange(SOAPY_SDR_RX, 0))
{
result.push_back(osmosdr::range_t(r.minimum(), r.maximum()));
}
#else
- BOOST_FOREACH(const double rate, _device->listSampleRates(SOAPY_SDR_RX, 0))
+ for (const double rate : _device->listSampleRates(SOAPY_SDR_RX, 0))
{
result.push_back(osmosdr::range_t(rate));
}
@@ -152,7 +157,7 @@ double soapy_source_c::get_sample_rate( void )
osmosdr::freq_range_t soapy_source_c::get_freq_range( size_t chan )
{
osmosdr::meta_range_t result;
- BOOST_FOREACH(const SoapySDR::Range r, _device->getFrequencyRange(SOAPY_SDR_RX, 0))
+ for (const SoapySDR::Range r : _device->getFrequencyRange(SOAPY_SDR_RX, 0))
{
result.push_back(osmosdr::range_t(r.minimum(), r.maximum()));
}
@@ -333,12 +338,12 @@ osmosdr::freq_range_t soapy_source_c::get_bandwidth_range( size_t chan )
{
osmosdr::meta_range_t result;
#ifdef SOAPY_SDR_API_HAS_GET_BANDWIDTH_RANGE
- BOOST_FOREACH(const SoapySDR::Range &r, _device->getBandwidthRange(SOAPY_SDR_RX, 0))
+ for (const SoapySDR::Range &r : _device->getBandwidthRange(SOAPY_SDR_RX, 0))
{
result.push_back(osmosdr::range_t(r.minimum(), r.maximum()));
}
#else
- BOOST_FOREACH(const double bw, _device->listBandwidths(SOAPY_SDR_RX, 0))
+ for (const double bw : _device->listBandwidths(SOAPY_SDR_RX, 0))
{
result.push_back(osmosdr::range_t(bw));
}
diff --git a/lib/soapy/soapy_source_c.h b/lib/soapy/soapy_source_c.h
index b4db1ce..7ae6322 100644
--- a/lib/soapy/soapy_source_c.h
+++ b/lib/soapy/soapy_source_c.h
@@ -36,7 +36,7 @@ namespace SoapySDR
}
/*
- * We use boost::shared_ptr's instead of raw pointers for all access
+ * We use std::shared_ptr's instead of raw pointers for all access
* to gr_blocks (and many other data structures). The shared_ptr gets
* us transparent reference counting, which greatly simplifies storage
* management issues. This is especially helpful in our hybrid
@@ -44,9 +44,9 @@ namespace SoapySDR
*
* See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
*
- * As a convention, the _sptr suffix indicates a boost::shared_ptr
+ * As a convention, the _sptr suffix indicates a std::shared_ptr
*/
-typedef boost::shared_ptr<soapy_source_c> soapy_source_c_sptr;
+typedef std::shared_ptr<soapy_source_c> soapy_source_c_sptr;
/*!
* \brief Return a shared_ptr to a new instance of soapy_source_c.
diff --git a/lib/source_iface.h b/lib/source_iface.h
index abb70eb..02e4da3 100644
--- a/lib/source_iface.h
+++ b/lib/source_iface.h
@@ -32,6 +32,8 @@
class source_iface
{
public:
+ virtual ~source_iface() = default;
+
/*!
* Get the number of channels the underlying radio hardware offers.
* \return the number of available channels
@@ -43,6 +45,7 @@ public:
*
* \param seek_point sample offset in file
* \param whence one of SEEK_SET, SEEK_CUR, SEEK_END (man fseek)
+ * \param chan the channel index 0 to N-1
* \return true on success
*/
virtual bool seek( long seek_point, int whence, size_t chan = 0 ) { return false; }
@@ -210,6 +213,7 @@ public:
/*!
* Select the active antenna of the underlying radio hardware.
+ * \param antenna the antenna name
* \param chan the channel index 0 to N-1
* \return the actual antenna's name
*/
diff --git a/lib/source_impl.cc b/lib/source_impl.cc
index a8a3cec..3d2a266 100644
--- a/lib/source_impl.cc
+++ b/lib/source_impl.cc
@@ -32,10 +32,6 @@
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/constants.h>
-#ifdef ENABLE_OSMOSDR
-#include <osmosdr_src_c.h>
-#endif
-
#ifdef ENABLE_FCD
#include <fcd_source_c.h>
#endif
@@ -80,6 +76,10 @@
#include <airspy_source_c.h>
#endif
+#ifdef ENABLE_AIRSPYHF
+#include <airspyhf_source_c.h>
+#endif
+
#ifdef ENABLE_SOAPY
#include <soapy_source_c.h>
#endif
@@ -92,6 +92,10 @@
#include <freesrp_source_c.h>
#endif
+#ifdef ENABLE_XTRX
+#include <xtrx_source_c.h>
+#endif
+
#include "arg_helpers.h"
#include "source_impl.h"
@@ -124,9 +128,6 @@ source_impl::source_impl( const std::string &args )
#ifdef ENABLE_FILE
dev_types.push_back("file");
#endif
-#ifdef ENABLE_OSMOSDR
- dev_types.push_back("osmosdr");
-#endif
#ifdef ENABLE_FCD
dev_types.push_back("fcd");
#endif
@@ -157,6 +158,9 @@ source_impl::source_impl( const std::string &args )
#ifdef ENABLE_AIRSPY
dev_types.push_back("airspy");
#endif
+#ifdef ENABLE_AIRSPYHF
+ dev_types.push_back("airspyhf");
+#endif
#ifdef ENABLE_SOAPY
dev_types.push_back("soapy");
#endif
@@ -166,11 +170,14 @@ source_impl::source_impl( const std::string &args )
#ifdef ENABLE_FREESRP
dev_types.push_back("freesrp");
#endif
+#ifdef ENABLE_XTRX
+ dev_types.push_back("xtrx");
+#endif
std::cerr << "gr-osmosdr "
<< GR_OSMOSDR_VERSION << " (" << GR_OSMOSDR_LIBVER << ") "
<< "gnuradio " << gr::version() << std::endl;
std::cerr << "built-in source types: ";
- BOOST_FOREACH(std::string dev_type, dev_types)
+ for (std::string dev_type : dev_types)
std::cerr << dev_type << " ";
std::cerr << std::endl;
@@ -179,11 +186,12 @@ source_impl::source_impl( const std::string &args )
dev_types.push_back("sdr-ip");
dev_types.push_back("netsdr");
dev_types.push_back("cloudiq");
+ dev_types.push_back("cloudsdr");
#endif
- BOOST_FOREACH(std::string arg, arg_list) {
+ for (std::string arg : arg_list) {
dict_t dict = params_to_dict(arg);
- BOOST_FOREACH(std::string dev_type, dev_types) {
+ for (std::string dev_type : dev_types) {
if ( dict.count( dev_type ) ) {
device_specified = true;
break;
@@ -193,61 +201,65 @@ source_impl::source_impl( const std::string &args )
if ( ! device_specified ) {
std::vector< std::string > dev_list;
-#ifdef ENABLE_OSMOSDR
- BOOST_FOREACH( std::string dev, osmosdr_src_c::get_devices() )
- dev_list.push_back( dev );
-#endif
#ifdef ENABLE_FCD
- BOOST_FOREACH( std::string dev, fcd_source_c::get_devices() )
+ for (std::string dev : fcd_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_RTL
- BOOST_FOREACH( std::string dev, rtl_source_c::get_devices() )
+ for (std::string dev : rtl_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_UHD
- BOOST_FOREACH( std::string dev, uhd_source_c::get_devices() )
+ for (std::string dev : uhd_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_MIRI
- BOOST_FOREACH( std::string dev, miri_source_c::get_devices() )
+ for (std::string dev : miri_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_SDRPLAY
- BOOST_FOREACH( std::string dev, sdrplay_source_c::get_devices() )
+ for (std::string dev : sdrplay_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_BLADERF
- BOOST_FOREACH( std::string dev, bladerf_source_c::get_devices() )
+ for (std::string dev : bladerf_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_RFSPACE
- BOOST_FOREACH( std::string dev, rfspace_source_c::get_devices() )
+ for (std::string dev : rfspace_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_HACKRF
- BOOST_FOREACH( std::string dev, hackrf_source_c::get_devices() )
+ for (std::string dev : hackrf_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_AIRSPY
- BOOST_FOREACH( std::string dev, airspy_source_c::get_devices() )
+ for (std::string dev : airspy_source_c::get_devices())
+ dev_list.push_back( dev );
+#endif
+#ifdef ENABLE_AIRSPYHF
+ for (std::string dev : airspyhf_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_SOAPY
- BOOST_FOREACH( std::string dev, soapy_source_c::get_devices() )
+ for (std::string dev : soapy_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_REDPITAYA
- BOOST_FOREACH( std::string dev, redpitaya_source_c::get_devices() )
+ for (std::string dev : redpitaya_source_c::get_devices())
dev_list.push_back( dev );
#endif
#ifdef ENABLE_FREESRP
- BOOST_FOREACH( std::string dev, freesrp_source_c::get_devices() )
+ for (std::string dev : freesrp_source_c::get_devices())
+ dev_list.push_back( dev );
+#endif
+#ifdef ENABLE_XTRX
+ for (std::string dev : xtrx_source_c::get_devices())
dev_list.push_back( dev );
#endif
// std::cerr << std::endl;
-// BOOST_FOREACH( std::string dev, dev_list )
+// for (std::string dev : dev_list)
// std::cerr << "'" << dev << "'" << std::endl;
if ( dev_list.size() )
@@ -256,24 +268,17 @@ source_impl::source_impl( const std::string &args )
throw std::runtime_error("No supported devices found (check the connection and/or udev rules).");
}
- BOOST_FOREACH(std::string arg, arg_list) {
+ for (std::string arg : arg_list) {
dict_t dict = params_to_dict(arg);
// std::cerr << std::endl;
-// BOOST_FOREACH( dict_t::value_type &entry, dict )
+// for (dict_t::value_type &entry : dict)
// std::cerr << "'" << entry.first << "' = '" << entry.second << "'" << std::endl;
source_iface *iface = NULL;
gr::basic_block_sptr block;
-#ifdef ENABLE_OSMOSDR
- if ( dict.count("osmosdr") ) {
- osmosdr_src_c_sptr src = osmosdr_make_src_c( arg );
- block = src; iface = src.get();
- }
-#endif
-
#ifdef ENABLE_FCD
if ( dict.count("fcd") ) {
fcd_source_c_sptr src = make_fcd_source_c( arg );
@@ -342,7 +347,8 @@ source_impl::source_impl( const std::string &args )
dict.count("sdr-iq") ||
dict.count("sdr-ip") ||
dict.count("netsdr") ||
- dict.count("cloudiq") ) {
+ dict.count("cloudiq") ||
+ dict.count("cloudsdr") ) {
rfspace_source_c_sptr src = make_rfspace_source_c( arg );
block = src; iface = src.get();
}
@@ -355,6 +361,13 @@ source_impl::source_impl( const std::string &args )
}
#endif
+#ifdef ENABLE_AIRSPYHF
+ if ( dict.count("airspyhf") ) {
+ airspyhf_source_c_sptr src = make_airspyhf_source_c( arg );
+ block = src; iface = src.get();
+ }
+#endif
+
#ifdef ENABLE_SOAPY
if ( dict.count("soapy") ) {
soapy_source_c_sptr src = make_soapy_source_c( arg );
@@ -376,7 +389,14 @@ source_impl::source_impl( const std::string &args )
}
#endif
- if ( iface != NULL && long(block.get()) != 0 ) {
+#ifdef ENABLE_XTRX
+ if ( dict.count("xtrx") ) {
+ xtrx_source_c_sptr src = make_xtrx_source_c( arg );
+ block = src; iface = src.get();
+ }
+#endif
+
+ if (iface != NULL && reinterpret_cast<std::intptr_t>(block.get()) != 0 ) {
_devs.push_back( iface );
for (size_t i = 0; i < iface->get_num_channels(); i++) {
@@ -396,20 +416,27 @@ source_impl::source_impl( const std::string &args )
connect(block, i, self(), channel++);
#endif
}
- } else if ( (iface != NULL) || (long(block.get()) != 0) )
+ } else if ((iface != NULL) || (reinterpret_cast<std::intptr_t>(block.get()) != 0))
throw std::runtime_error("Either iface or block are NULL.");
}
if (!_devs.size())
throw std::runtime_error("No devices specified via device arguments.");
+
+ /* Populate the _gain and _gain_mode arrays with the hardware state */
+ for ( source_iface *dev : _devs )
+ for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
+ _gain_mode[dev_chan] = dev->get_gain_mode(dev_chan);
+ _gain[dev_chan] = dev->get_gain(dev_chan);
+ }
}
size_t source_impl::get_num_channels()
{
size_t channels = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
channels += dev->get_num_channels();
return channels;
@@ -418,7 +445,7 @@ size_t source_impl::get_num_channels()
bool source_impl::seek( long seek_point, int whence, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->seek( seek_point, whence, dev_chan );
@@ -448,12 +475,12 @@ double source_impl::set_sample_rate(double rate)
if (_devs.empty())
throw std::runtime_error(NO_DEVICES_MSG);
#endif
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
sample_rate = dev->set_sample_rate(rate);
#ifdef HAVE_IQBALANCE
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs ) {
+ for (source_iface *dev : _devs) {
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
if ( channel < _iq_opt.size() ) {
gr::iqbalance::optimize_c *opt = _iq_opt[channel];
@@ -472,7 +499,7 @@ double source_impl::set_sample_rate(double rate)
_sample_rate = sample_rate;
}
- return sample_rate;
+ return _sample_rate;
}
double source_impl::get_sample_rate()
@@ -491,7 +518,7 @@ double source_impl::get_sample_rate()
osmosdr::freq_range_t source_impl::get_freq_range( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_freq_range( dev_chan );
@@ -502,7 +529,7 @@ osmosdr::freq_range_t source_impl::get_freq_range( size_t chan )
double source_impl::set_center_freq( double freq, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _center_freq[ chan ] != freq ) {
@@ -517,7 +544,7 @@ double source_impl::set_center_freq( double freq, size_t chan )
double source_impl::get_center_freq( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_center_freq( dev_chan );
@@ -528,7 +555,7 @@ double source_impl::get_center_freq( size_t chan )
double source_impl::set_freq_corr( double ppm, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _freq_corr[ chan ] != ppm ) {
@@ -543,7 +570,7 @@ double source_impl::set_freq_corr( double ppm, size_t chan )
double source_impl::get_freq_corr( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_freq_corr( dev_chan );
@@ -554,7 +581,7 @@ double source_impl::get_freq_corr( size_t chan )
std::vector<std::string> source_impl::get_gain_names( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_names( dev_chan );
@@ -565,7 +592,7 @@ std::vector<std::string> source_impl::get_gain_names( size_t chan )
osmosdr::gain_range_t source_impl::get_gain_range( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_range( dev_chan );
@@ -576,7 +603,7 @@ osmosdr::gain_range_t source_impl::get_gain_range( size_t chan )
osmosdr::gain_range_t source_impl::get_gain_range( const std::string & name, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_range( name, dev_chan );
@@ -587,10 +614,10 @@ osmosdr::gain_range_t source_impl::get_gain_range( const std::string & name, siz
bool source_impl::set_gain_mode( bool automatic, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
- if ( _gain_mode[ chan ] != automatic ) {
+ if ( (_gain_mode.count(chan) == 0) || (_gain_mode[ chan ] != automatic) ) {
_gain_mode[ chan ] = automatic;
bool mode = dev->set_gain_mode( automatic, dev_chan );
if (!automatic) // reapply gain value when switched to manual mode
@@ -605,7 +632,7 @@ bool source_impl::set_gain_mode( bool automatic, size_t chan )
bool source_impl::get_gain_mode( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain_mode( dev_chan );
@@ -616,7 +643,7 @@ bool source_impl::get_gain_mode( size_t chan )
double source_impl::set_gain( double gain, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _gain[ chan ] != gain ) {
@@ -631,7 +658,7 @@ double source_impl::set_gain( double gain, size_t chan )
double source_impl::set_gain( double gain, const std::string & name, size_t chan)
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->set_gain( gain, name, dev_chan );
@@ -642,7 +669,7 @@ double source_impl::set_gain( double gain, const std::string & name, size_t chan
double source_impl::get_gain( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain( dev_chan );
@@ -653,7 +680,7 @@ double source_impl::get_gain( size_t chan )
double source_impl::get_gain( const std::string & name, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_gain( name, dev_chan );
@@ -664,7 +691,7 @@ double source_impl::get_gain( const std::string & name, size_t chan )
double source_impl::set_if_gain( double gain, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _if_gain[ chan ] != gain ) {
@@ -679,7 +706,7 @@ double source_impl::set_if_gain( double gain, size_t chan )
double source_impl::set_bb_gain( double gain, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _bb_gain[ chan ] != gain ) {
@@ -694,7 +721,7 @@ double source_impl::set_bb_gain( double gain, size_t chan )
std::vector< std::string > source_impl::get_antennas( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_antennas( dev_chan );
@@ -705,7 +732,7 @@ std::vector< std::string > source_impl::get_antennas( size_t chan )
std::string source_impl::set_antenna( const std::string & antenna, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _antenna[ chan ] != antenna ) {
@@ -720,7 +747,7 @@ std::string source_impl::set_antenna( const std::string & antenna, size_t chan )
std::string source_impl::get_antenna( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_antenna( dev_chan );
@@ -731,7 +758,7 @@ std::string source_impl::get_antenna( size_t chan )
void source_impl::set_dc_offset_mode( int mode, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
dev->set_dc_offset_mode( mode, dev_chan );
@@ -740,7 +767,7 @@ void source_impl::set_dc_offset_mode( int mode, size_t chan )
void source_impl::set_dc_offset( const std::complex<double> &offset, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
dev->set_dc_offset( offset, dev_chan );
@@ -750,7 +777,7 @@ void source_impl::set_iq_balance_mode( int mode, size_t chan )
{
size_t channel = 0;
#ifdef HAVE_IQBALANCE
- BOOST_FOREACH( source_iface *dev, _devs ) {
+ for (source_iface *dev : _devs) {
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
if ( chan == channel++ ) {
if ( chan < _iq_opt.size() && chan < _iq_fix.size() ) {
@@ -780,7 +807,7 @@ void source_impl::set_iq_balance_mode( int mode, size_t chan )
}
}
#else
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->set_iq_balance_mode( mode, dev_chan );
@@ -791,7 +818,7 @@ void source_impl::set_iq_balance( const std::complex<double> &balance, size_t ch
{
size_t channel = 0;
#ifdef HAVE_IQBALANCE
- BOOST_FOREACH( source_iface *dev, _devs ) {
+ for (source_iface *dev : _devs) {
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
if ( chan == channel++ ) {
if ( chan < _iq_opt.size() && chan < _iq_fix.size() ) {
@@ -807,7 +834,7 @@ void source_impl::set_iq_balance( const std::complex<double> &balance, size_t ch
}
}
#else
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->set_iq_balance( balance, dev_chan );
@@ -817,7 +844,7 @@ void source_impl::set_iq_balance( const std::complex<double> &balance, size_t ch
double source_impl::set_bandwidth( double bandwidth, size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ ) {
if ( _bandwidth[ chan ] != bandwidth || 0.0f == bandwidth ) {
@@ -832,7 +859,7 @@ double source_impl::set_bandwidth( double bandwidth, size_t chan )
double source_impl::get_bandwidth( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_bandwidth( dev_chan );
@@ -843,7 +870,7 @@ double source_impl::get_bandwidth( size_t chan )
osmosdr::freq_range_t source_impl::get_bandwidth_range( size_t chan )
{
size_t channel = 0;
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
return dev->get_bandwidth_range( dev_chan );
@@ -936,7 +963,7 @@ void source_impl::set_time_now(const osmosdr::time_spec_t &time_spec, size_t mbo
void source_impl::set_time_next_pps(const osmosdr::time_spec_t &time_spec)
{
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
{
dev->set_time_next_pps( time_spec );
}
@@ -944,7 +971,7 @@ void source_impl::set_time_next_pps(const osmosdr::time_spec_t &time_spec)
void source_impl::set_time_unknown_pps(const osmosdr::time_spec_t &time_spec)
{
- BOOST_FOREACH( source_iface *dev, _devs )
+ for (source_iface *dev : _devs)
{
dev->set_time_unknown_pps( time_spec );
}
diff --git a/lib/uhd/CMakeLists.txt b/lib/uhd/CMakeLists.txt
index aba5c77..0ab6508 100644
--- a/lib/uhd/CMakeLists.txt
+++ b/lib/uhd/CMakeLists.txt
@@ -1,19 +1,19 @@
# Copyright 2012 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file is part of gr-osmosdr
#
-# GNU Radio is free software; you can redistribute it and/or modify
+# gr-osmosdr 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, or (at your option)
# any later version.
#
-# GNU Radio is distributed in the hope that it will be useful,
+# gr-osmosdr 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 GNU Radio; see the file COPYING. If not, write to
+# along with gr-osmosdr; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
@@ -21,19 +21,19 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
- ${GNURADIO_UHD_INCLUDE_DIRS}
+ ${gnuradio-uhd_INCLUDE_DIRS}
${UHD_INCLUDE_DIRS}
)
-set(uhd_srcs
+APPEND_LIB_LIST(
+ gnuradio::gnuradio-uhd
+ ${UHD_LIBRARIES}
+)
+
+list(APPEND gr_osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/uhd_sink_c.cc
${CMAKE_CURRENT_SOURCE_DIR}/uhd_source_c.cc
)
-
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${uhd_srcs})
-list(APPEND gr_osmosdr_libs ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES})
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/uhd/uhd_sink_c.cc b/lib/uhd/uhd_sink_c.cc
index a154556..8698f4c 100644
--- a/lib/uhd/uhd_sink_c.cc
+++ b/lib/uhd/uhd_sink_c.cc
@@ -18,7 +18,6 @@
* Boston, MA 02110-1301, USA.
*/
-#include <boost/foreach.hpp>
#include <boost/assign.hpp>
#include <boost/algorithm/string.hpp>
@@ -71,7 +70,7 @@ uhd_sink_c::uhd_sink_c(const std::string &args) :
_lo_offset = boost::lexical_cast< double >( dict["lo_offset"] );
std::string arguments; // rebuild argument string without internal arguments
- BOOST_FOREACH( dict_t::value_type &entry, dict )
+ for (dict_t::value_type &entry : dict)
{
if ( "cpu_format" == entry.first ||
"otw_format" == entry.first ||
@@ -135,7 +134,7 @@ std::vector< std::string > uhd_sink_c::get_devices()
std::vector< std::string > devices;
uhd::device_addr_t hint;
- BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
+ for (const uhd::device_addr_t &dev : uhd::device::find(hint))
{
std::string args = "uhd," + dev.to_string();
@@ -190,7 +189,7 @@ osmosdr::meta_range_t uhd_sink_c::get_sample_rates( void )
{
osmosdr::meta_range_t rates;
- BOOST_FOREACH( uhd::range_t rate, _snk->get_samp_rates() )
+ for (uhd::range_t rate : _snk->get_samp_rates())
rates += osmosdr::range_t( rate.start(), rate.stop(), rate.step() );
return rates;
@@ -211,7 +210,7 @@ osmosdr::freq_range_t uhd_sink_c::get_freq_range( size_t chan )
{
osmosdr::freq_range_t range;
- BOOST_FOREACH( uhd::range_t freq, _snk->get_freq_range(chan) )
+ for (uhd::range_t freq : _snk->get_freq_range(chan))
range += osmosdr::range_t( freq.start(), freq.stop(), freq.step() );
return range;
@@ -260,7 +259,7 @@ osmosdr::gain_range_t uhd_sink_c::get_gain_range( size_t chan )
{
osmosdr::gain_range_t range;
- BOOST_FOREACH( uhd::range_t gain, _snk->get_gain_range(chan) )
+ for (uhd::range_t gain : _snk->get_gain_range(chan))
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -270,7 +269,7 @@ osmosdr::gain_range_t uhd_sink_c::get_gain_range( const std::string & name, size
{
osmosdr::gain_range_t range;
- BOOST_FOREACH( uhd::range_t gain, _snk->get_gain_range(name, chan) )
+ for (uhd::range_t gain : _snk->get_gain_range(name, chan))
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -351,7 +350,7 @@ osmosdr::freq_range_t uhd_sink_c::get_bandwidth_range( size_t chan )
{
osmosdr::freq_range_t bandwidths;
- BOOST_FOREACH( uhd::range_t bw, _snk->get_bandwidth_range(chan) )
+ for (uhd::range_t bw : _snk->get_bandwidth_range(chan))
bandwidths += osmosdr::range_t( bw.start(), bw.stop(), bw.step() );
return bandwidths;
diff --git a/lib/uhd/uhd_sink_c.h b/lib/uhd/uhd_sink_c.h
index 700fe4a..9b673b0 100644
--- a/lib/uhd/uhd_sink_c.h
+++ b/lib/uhd/uhd_sink_c.h
@@ -27,7 +27,7 @@
class uhd_sink_c;
-typedef boost::shared_ptr< uhd_sink_c > uhd_sink_c_sptr;
+typedef std::shared_ptr< uhd_sink_c > uhd_sink_c_sptr;
uhd_sink_c_sptr make_uhd_sink_c(const std::string &args = "");
diff --git a/lib/uhd/uhd_source_c.cc b/lib/uhd/uhd_source_c.cc
index fc13017..f9f9fdd 100644
--- a/lib/uhd/uhd_source_c.cc
+++ b/lib/uhd/uhd_source_c.cc
@@ -18,7 +18,6 @@
* Boston, MA 02110-1301, USA.
*/
-#include <boost/foreach.hpp>
#include <boost/assign.hpp>
#include <boost/algorithm/string.hpp>
@@ -72,7 +71,7 @@ uhd_source_c::uhd_source_c(const std::string &args) :
_lo_offset = boost::lexical_cast< double >( dict["lo_offset"] );
std::string arguments; // rebuild argument string without internal arguments
- BOOST_FOREACH( dict_t::value_type &entry, dict )
+ for (dict_t::value_type &entry : dict)
{
if ( "cpu_format" == entry.first ||
"otw_format" == entry.first ||
@@ -136,7 +135,7 @@ std::vector< std::string > uhd_source_c::get_devices()
std::vector< std::string > devices;
uhd::device_addr_t hint;
- BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint))
+ for (const uhd::device_addr_t &dev : uhd::device::find(hint))
{
std::string args = "uhd," + dev.to_string();
@@ -191,7 +190,7 @@ osmosdr::meta_range_t uhd_source_c::get_sample_rates( void )
{
osmosdr::meta_range_t rates;
- BOOST_FOREACH( uhd::range_t rate, _src->get_samp_rates() )
+ for (uhd::range_t rate : _src->get_samp_rates())
rates += osmosdr::range_t( rate.start(), rate.stop(), rate.step() );
return rates;
@@ -212,7 +211,7 @@ osmosdr::freq_range_t uhd_source_c::get_freq_range( size_t chan )
{
osmosdr::freq_range_t range;
- BOOST_FOREACH( uhd::range_t freq, _src->get_freq_range(chan) )
+ for (uhd::range_t freq : _src->get_freq_range(chan))
range += osmosdr::range_t( freq.start(), freq.stop(), freq.step() );
return range;
@@ -261,7 +260,7 @@ osmosdr::gain_range_t uhd_source_c::get_gain_range( size_t chan )
{
osmosdr::gain_range_t range;
- BOOST_FOREACH( uhd::range_t gain, _src->get_gain_range(chan) )
+ for (uhd::range_t gain : _src->get_gain_range(chan))
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -271,7 +270,7 @@ osmosdr::gain_range_t uhd_source_c::get_gain_range( const std::string & name, si
{
osmosdr::gain_range_t range;
- BOOST_FOREACH( uhd::range_t gain, _src->get_gain_range(name, chan) )
+ for (uhd::range_t gain : _src->get_gain_range(name, chan))
range += osmosdr::range_t( gain.start(), gain.stop(), gain.step() );
return range;
@@ -383,7 +382,7 @@ osmosdr::freq_range_t uhd_source_c::get_bandwidth_range( size_t chan )
{
osmosdr::freq_range_t bandwidths;
- BOOST_FOREACH( uhd::range_t bw, _src->get_bandwidth_range(chan) )
+ for (uhd::range_t bw : _src->get_bandwidth_range(chan))
bandwidths += osmosdr::range_t( bw.start(), bw.stop(), bw.step() );
return bandwidths;
diff --git a/lib/uhd/uhd_source_c.h b/lib/uhd/uhd_source_c.h
index e80be99..f3b2797 100644
--- a/lib/uhd/uhd_source_c.h
+++ b/lib/uhd/uhd_source_c.h
@@ -27,7 +27,7 @@
class uhd_source_c;
-typedef boost::shared_ptr< uhd_source_c > uhd_source_c_sptr;
+typedef std::shared_ptr< uhd_source_c > uhd_source_c_sptr;
uhd_source_c_sptr make_uhd_source_c(const std::string &args = "");
diff --git a/lib/osmosdr/CMakeLists.txt b/lib/xtrx/CMakeLists.txt
index b0872f8..7f31829 100644
--- a/lib/osmosdr/CMakeLists.txt
+++ b/lib/xtrx/CMakeLists.txt
@@ -21,17 +21,19 @@
# This file included, use CMake directory variables
########################################################################
-include_directories(
+target_include_directories(gnuradio-osmosdr PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
- ${LIBOSMOSDR_INCLUDE_DIRS}
+ ${LIBXTRX_INCLUDE_DIRS}
)
-set(osmosdr_srcs
- ${CMAKE_CURRENT_SOURCE_DIR}/osmosdr_src_c.cc
+APPEND_LIB_LIST(
+ ${LIBXTRX_LIBRARIES}
)
-########################################################################
-# Append gnuradio-osmosdr library sources
-########################################################################
-list(APPEND gr_osmosdr_srcs ${osmosdr_srcs})
-list(APPEND gr_osmosdr_libs ${LIBOSMOSDR_LIBRARIES})
+list(APPEND gr_osmosdr_srcs
+ ${CMAKE_CURRENT_SOURCE_DIR}/xtrx_obj.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/xtrx_source_c.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/xtrx_sink_c.cc
+)
+
+set(gr_osmosdr_srcs ${gr_osmosdr_srcs} PARENT_SCOPE)
diff --git a/lib/xtrx/xtrx_obj.cc b/lib/xtrx/xtrx_obj.cc
new file mode 100644
index 0000000..016b420
--- /dev/null
+++ b/lib/xtrx/xtrx_obj.cc
@@ -0,0 +1,138 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2017 Sergey Kostanbaev <sergey.kostanbaev@fairwaves.co>
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#include "xtrx_obj.h"
+#include <iostream>
+#include <sstream>
+#include <boost/thread.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+
+static std::map<std::string, xtrx_obj_sptr> s_objects;
+
+xtrx_obj_sptr xtrx_obj::get(const char* xtrx_dev,
+ unsigned loglevel,
+ bool lmsreset)
+{
+ std::map<std::string, xtrx_obj_sptr>::iterator i;
+ std::string name(xtrx_dev);
+
+ i = s_objects.find(name);
+ if (i == s_objects.end()) {
+ // No such object
+ s_objects[name].reset(new xtrx_obj(name, loglevel, lmsreset));
+ }
+
+ return s_objects[name];
+}
+
+void xtrx_obj::clear_all()
+{
+ s_objects.clear();
+}
+
+std::vector<std::string> xtrx_obj::get_devices()
+{
+ std::vector<std::string> devices;
+ // TODO
+ devices.push_back("/dev/xtrx0");
+ return devices;
+}
+
+
+xtrx_obj::xtrx_obj(const std::string &path, unsigned loglevel, bool lmsreset)
+ : _run(false)
+ , _vio(0)
+ , _sink_rate(0)
+ , _sink_master(0)
+ , _source_rate(0)
+ , _source_master(0)
+ , _flags(0)
+{
+ unsigned xtrxflag = (loglevel & XTRX_O_LOGLVL_MASK) | ((lmsreset) ? XTRX_O_RESET : 0);
+ std::cerr << "xtrx_obj::xtrx_obj = " << xtrxflag << std::endl;
+
+ int res = xtrx_open_string(path.c_str(), &_obj);
+ if (res < 0) {
+ std::stringstream message;
+ message << "Couldn't open " ": Error: " << -res;
+
+ throw std::runtime_error( message.str() );
+ }
+
+ _devices = res;
+}
+
+double xtrx_obj::set_smaplerate(double rate, double master, bool sink, unsigned flags)
+{
+ boost::mutex::scoped_lock lock(mtx);
+
+ if (sink) {
+ _sink_rate = rate;
+ _sink_master = master;
+ } else {
+ _source_rate = rate;
+ _source_master = master;
+ }
+ _flags |= flags | XTRX_SAMPLERATE_FORCE_UPDATE;
+
+ if (_sink_master != 0 && _source_master != 0 && _sink_master != _source_master) {
+ std::stringstream message;
+ message << "Can't operate on diferrent master settings for XTRX sink and source"
+ " sink_master " << _sink_master << " source_master" << _source_master;
+
+ throw std::runtime_error( message.str() );
+ }
+
+ double rxrate = 0, txrate = 0;
+ double actmaster = (_source_master > 0) ? _source_master : _sink_master;
+ int res = xtrx_set_samplerate(_obj,
+ actmaster,
+ _source_rate,
+ _sink_rate,
+ _flags,
+ NULL,
+ &rxrate,
+ &txrate);
+ if (res) {
+ std::cerr << "Unable to set samplerate, error=" << res << std::endl;
+ if (sink)
+ return _sink_rate;
+ return _source_rate;
+ }
+
+ if (_vio) {
+ xtrx_val_set(_obj, XTRX_TRX, XTRX_CH_AB, XTRX_LMS7_VIO, _vio);
+ }
+
+ if (sink)
+ return txrate;
+ return rxrate;
+}
+
+xtrx_obj::~xtrx_obj()
+{
+ if (_obj) {
+ if (_run) {
+ //boost::mutex::scoped_lock lock(mtx);
+ xtrx_stop(_obj, XTRX_TRX);
+ }
+ xtrx_close(_obj);
+ }
+}
diff --git a/lib/xtrx/xtrx_obj.h b/lib/xtrx/xtrx_obj.h
new file mode 100644
index 0000000..8f64260
--- /dev/null
+++ b/lib/xtrx/xtrx_obj.h
@@ -0,0 +1,68 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2017 Sergey Kostanbaev <sergey.kostanbaev@fairwaves.co>
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifndef XTRX_OBJ_H
+#define XTRX_OBJ_H
+
+#include <boost/shared_ptr.hpp>
+#include <xtrx_api.h>
+#include <map>
+#include <vector>
+#include <boost/thread/mutex.hpp>
+
+class xtrx_obj;
+
+typedef std::shared_ptr<xtrx_obj> xtrx_obj_sptr;
+
+class xtrx_obj
+{
+public:
+ xtrx_obj(const std::string& path, unsigned loglevel, bool lmsreset);
+ ~xtrx_obj();
+
+ static std::vector<std::string> get_devices();
+
+ static xtrx_obj_sptr get(const char* xtrx_dev,
+ unsigned loglevel,
+ bool lmsreset);
+ static void clear_all();
+
+ xtrx_dev* dev() { return _obj; }
+ unsigned dev_count() { return _devices; }
+
+ double set_smaplerate(double rate, double master, bool sink, unsigned flags);
+
+ void set_vio(unsigned vio) { _vio = vio; }
+
+ boost::mutex mtx;
+protected:
+ xtrx_dev* _obj;
+ bool _run;
+ unsigned _vio;
+
+ double _sink_rate;
+ double _sink_master;
+ double _source_rate;
+ double _source_master;
+
+ unsigned _flags;
+ unsigned _devices;
+};
+
+#endif // XTRX_OBJ_H
diff --git a/lib/xtrx/xtrx_sink_c.cc b/lib/xtrx/xtrx_sink_c.cc
new file mode 100644
index 0000000..5253311
--- /dev/null
+++ b/lib/xtrx/xtrx_sink_c.cc
@@ -0,0 +1,505 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2016,2017 Sergey Kostanbaev <sergey.kostanbaev@fairwaves.co>
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#include <fstream>
+#include <string>
+#include <sstream>
+#include <map>
+
+#include <boost/assign.hpp>
+#include <boost/algorithm/string.hpp>
+#include <boost/thread.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+
+#include <gnuradio/io_signature.h>
+#include <gnuradio/blocks/deinterleave.h>
+#include <gnuradio/blocks/float_to_complex.h>
+
+#include "xtrx_sink_c.h"
+
+#include "arg_helpers.h"
+
+static const int max_burstsz = 4096;
+using namespace boost::assign;
+
+xtrx_sink_c_sptr make_xtrx_sink_c(const std::string &args)
+{
+ return gnuradio::get_initial_sptr(new xtrx_sink_c(args));
+}
+
+static size_t parse_nchan(const std::string &args)
+{
+ size_t nchan = 1;
+
+ dict_t dict = params_to_dict(args);
+
+ if (dict.count("nchan"))
+ nchan = boost::lexical_cast< size_t >( dict["nchan"] );
+
+ if (nchan < 1)
+ nchan = 1;
+
+ return nchan;
+}
+
+xtrx_sink_c::xtrx_sink_c(const std::string &args) :
+ gr::sync_block("xtrx_sink_c",
+ gr::io_signature::make(parse_nchan(args),
+ parse_nchan(args),
+ sizeof(gr_complex)),
+ gr::io_signature::make(0, 0, 0)),
+ _sample_flags(0),
+ _rate(0),
+ _master(0),
+ _freq(0),
+ _corr(0),
+ _bandwidth(0),
+ _dsp(0),
+ _auto_gain(false),
+ _otw(XTRX_WF_16),
+ _mimo_mode(false),
+ _gain_tx(0),
+ _channels(parse_nchan(args)),
+ _ts(8192),
+ _swap_ab(false),
+ _swap_iq(false),
+ _tdd(false),
+ _allow_dis(false),
+ _dev("")
+{
+
+ dict_t dict = params_to_dict(args);
+
+ if (dict.count("master")) {
+ _master = boost::lexical_cast< double >( dict["master"]);
+ }
+
+ std::cerr << args.c_str() << std::endl;
+
+ int loglevel = 4;
+ if (dict.count("loglevel")) {
+ loglevel = boost::lexical_cast< int >( dict["loglevel"] );
+ }
+
+ bool lmsreset = 0;
+ if (dict.count("lmsreset")) {
+ lmsreset = boost::lexical_cast< bool >( dict["lmsreset"] );
+ }
+
+ if (dict.count("txdelay")) {
+ _ts += 8192 * boost::lexical_cast< int >( dict["txdelay"] );
+ }
+
+ if (dict.count("allowdis")) {
+ _allow_dis = boost::lexical_cast< bool >( dict["allowdis"] );
+ }
+
+ if (dict.count("swap_ab")) {
+ _swap_ab = true;
+ std::cerr << "xtrx_sink_c: swap AB channels";
+ }
+
+ if (dict.count("swap_iq")) {
+ _swap_iq = true;
+ std::cerr << "xtrx_sink_c: swap IQ";
+ }
+
+ if (dict.count("sfl")) {
+ _sample_flags = boost::lexical_cast< unsigned >( dict["sfl"] );
+ }
+
+ if (dict.count("tdd")) {
+ _tdd = true;
+ std::cerr << "xtrx_sink_c: TDD mode";
+ }
+
+ if (dict.count("dsp")) {
+ _dsp = boost::lexical_cast< double >( dict["dsp"] );
+ std::cerr << "xtrx_sink_c: DSP:" << _dsp;
+ }
+
+ if (dict.count("dev")) {
+ _dev = dict["dev"];
+ std::cerr << "xtrx_sink_c: XTRX device: %s" << _dev.c_str();
+ }
+
+ _xtrx = xtrx_obj::get(_dev.c_str(), loglevel, lmsreset);
+ if (_xtrx->dev_count() * 2 == _channels) {
+ _mimo_mode = true;
+ } else if (_xtrx->dev_count() != _channels) {
+ throw std::runtime_error("Number of requested channels != number of devices");
+ }
+ if (dict.count("refclk")) {
+ xtrx_set_ref_clk(_xtrx->dev(), boost::lexical_cast< unsigned >( dict["refclk"] ), XTRX_CLKSRC_INT);
+ }
+ if (dict.count("extclk")) {
+ xtrx_set_ref_clk(_xtrx->dev(), boost::lexical_cast< unsigned >( dict["extclk"] ), XTRX_CLKSRC_EXT);
+ }
+
+ std::cerr << "xtrx_sink_c::xtrx_sink_c()" << std::endl;
+ set_alignment(32);
+ set_output_multiple(max_burstsz);
+}
+
+xtrx_sink_c::~xtrx_sink_c()
+{
+ std::cerr << "xtrx_sink_c::~xtrx_sink_c()" << std::endl;
+}
+
+std::string xtrx_sink_c::name()
+{
+ return "GrLibXTRX";
+}
+
+size_t xtrx_sink_c::get_num_channels( void )
+{
+ return input_signature()->max_streams();
+}
+
+osmosdr::meta_range_t xtrx_sink_c::get_sample_rates( void )
+{
+ osmosdr::meta_range_t range;
+ range += osmosdr::range_t( 1000000, 160000000, 1 );
+ return range;
+}
+
+double xtrx_sink_c::set_sample_rate( double rate )
+{
+ std::cerr << "Set sample rate " << rate << std::endl;
+ _rate = _xtrx->set_smaplerate(rate, _master, true, _sample_flags);
+ return get_sample_rate();
+}
+
+double xtrx_sink_c::get_sample_rate( void )
+{
+ return _rate;
+}
+
+osmosdr::freq_range_t xtrx_sink_c::get_freq_range( size_t chan )
+{
+ osmosdr::freq_range_t range;
+ range += osmosdr::range_t( double(0.03e9), double(3.8e9), 1); // as far as we know
+ return range;
+}
+
+double xtrx_sink_c::set_center_freq( double freq, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+
+ _freq = freq;
+ double corr_freq = (freq)*(1.0 + (_corr) * 0.000001);
+
+ std::cerr << "TX Set freq " << freq << std::endl;
+ xtrx_channel_t xchan = (xtrx_channel_t)(XTRX_CH_A << chan);
+
+ int res = xtrx_tune_ex(_xtrx->dev(), (_tdd) ? XTRX_TUNE_TX_AND_RX_TDD : XTRX_TUNE_TX_FDD, xchan, corr_freq - _dsp, &_freq);
+ if (res) {
+ std::cerr << "Unable to deliver frequency " << corr_freq << std::endl;
+ }
+
+ res = xtrx_tune_ex(_xtrx->dev(), XTRX_TUNE_BB_TX, xchan, _dsp, NULL);
+ return get_center_freq(chan);
+}
+
+double xtrx_sink_c::get_center_freq( size_t chan )
+{
+ return _freq + _dsp;
+}
+
+double xtrx_sink_c::set_freq_corr( double ppm, size_t chan )
+{
+ _corr = ppm;
+
+ set_center_freq(_freq, chan);
+
+ return get_freq_corr( chan );
+}
+
+double xtrx_sink_c::get_freq_corr( size_t chan )
+{
+ return _corr;
+}
+
+
+static const std::vector<std::string> s_lna_list = boost::assign::list_of("TX");
+
+std::vector<std::string> xtrx_sink_c::get_gain_names( size_t chan )
+{
+ return s_lna_list;
+}
+
+osmosdr::gain_range_t xtrx_sink_c::get_gain_range( size_t chan )
+{
+ return get_gain_range("TX", chan);
+}
+
+osmosdr::gain_range_t xtrx_sink_c::get_gain_range( const std::string & name, size_t chan )
+{
+ osmosdr::gain_range_t range;
+ range += osmosdr::range_t( -31, 0, 1 );
+ return range;
+}
+
+bool xtrx_sink_c::set_gain_mode( bool automatic, size_t chan )
+{
+ _auto_gain = automatic;
+ return get_gain_mode(chan);
+}
+
+bool xtrx_sink_c::get_gain_mode( size_t chan )
+{
+ return _auto_gain;
+}
+
+double xtrx_sink_c::set_gain( double gain, size_t chan )
+{
+ return set_gain(gain, "TX", chan);
+}
+
+double xtrx_sink_c::set_gain( double igain, const std::string & name, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+
+ osmosdr::gain_range_t gains = xtrx_sink_c::get_gain_range( name, chan );
+ double gain = gains.clip(igain);
+ double actual_gain;
+
+ std::cerr << "Set TX gain: " << igain << std::endl;
+
+ int res = xtrx_set_gain(_xtrx->dev(), (xtrx_channel_t)(XTRX_CH_A << chan),
+ XTRX_TX_PAD_GAIN, gain, &actual_gain);
+ if (res) {
+ std::cerr << "Unable to set gain `" << name.c_str() << "`; err=" << res << std::endl;
+ }
+
+ _gain_tx = actual_gain;
+ return actual_gain;
+}
+
+double xtrx_sink_c::get_gain( size_t chan )
+{
+ return get_gain("TX");
+}
+
+double xtrx_sink_c::get_gain( const std::string & name, size_t chan )
+{
+ return _gain_tx;
+}
+
+double xtrx_sink_c::set_bandwidth( double bandwidth, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+ std::cerr << "Set bandwidth " << bandwidth << " chan " << chan << std::endl;
+
+ if (bandwidth <= 0.0) {
+ bandwidth = get_sample_rate() * 0.75;
+ if (bandwidth < 0.5e6) {
+ bandwidth = 0.5e6;
+ }
+ }
+
+ int res = xtrx_tune_tx_bandwidth(_xtrx->dev(),
+ (xtrx_channel_t)(XTRX_CH_A << chan),
+ bandwidth, &_bandwidth);
+ if (res) {
+ std::cerr << "Can't set bandwidth: " << res << std::endl;
+ }
+ return get_bandwidth(chan);
+}
+
+double xtrx_sink_c::get_bandwidth( size_t chan )
+{
+ return _bandwidth;
+}
+
+
+static const std::map<std::string, xtrx_antenna_t> s_ant_map = boost::assign::map_list_of
+ ("AUTO", XTRX_TX_AUTO)
+ ("B1", XTRX_TX_H)
+ ("B2", XTRX_TX_W)
+ ("TXH", XTRX_TX_H)
+ ("TXW", XTRX_TX_W)
+ ;
+static const std::map<xtrx_antenna_t, std::string> s_ant_map_r = boost::assign::map_list_of
+ (XTRX_TX_H, "TXH")
+ (XTRX_TX_W, "TXW")
+ (XTRX_TX_AUTO, "AUTO")
+ ;
+
+static xtrx_antenna_t get_ant_type(const std::string& name)
+{
+ std::map<std::string, xtrx_antenna_t>::const_iterator it;
+
+ it = s_ant_map.find(name);
+ if (it != s_ant_map.end()) {
+ return it->second;
+ }
+
+ return XTRX_TX_AUTO;
+}
+
+static const std::vector<std::string> s_ant_list = boost::assign::list_of
+ ("AUTO")("TXH")("TXW")
+ ;
+
+
+std::vector< std::string > xtrx_sink_c::get_antennas( size_t chan )
+{
+ return s_ant_list;
+}
+
+std::string xtrx_sink_c::set_antenna( const std::string & antenna, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+ _ant = get_ant_type(antenna);
+
+ std::cerr << "Set antenna " << antenna << std::endl;
+
+ int res = xtrx_set_antenna_ex(_xtrx->dev(),
+ (xtrx_channel_t)(XTRX_CH_A << chan),
+ _ant);
+ if (res) {
+ std::cerr << "Can't set antenna: " << antenna << std::endl;
+ }
+ return get_antenna( chan );
+}
+
+std::string xtrx_sink_c::get_antenna( size_t chan )
+{
+ return s_ant_map_r.find(_ant)->second;
+}
+
+void xtrx_sink_c::tag_process(int ninput_items)
+{
+ std::sort(_tags.begin(), _tags.end(), gr::tag_t::offset_compare);
+
+ const uint64_t samp0_count = this->nitems_read(0);
+ uint64_t max_count = samp0_count + ninput_items;
+
+ bool found_time_tag = false;
+ for (const gr::tag_t &my_tag : _tags) {
+ const uint64_t my_tag_count = my_tag.offset;
+ const pmt::pmt_t &key = my_tag.key;
+ const pmt::pmt_t &value = my_tag.value;
+
+ if (my_tag_count >= max_count) {
+ break;
+ } else if(pmt::equal(key, TIME_KEY)) {
+ //if (my_tag_count != samp0_count) {
+ // max_count = my_tag_count;
+ // break;
+ //}
+ found_time_tag = true;
+ //_metadata.has_time_spec = true;
+ //_metadata.time_spec = ::uhd::time_spec_t
+ // (pmt::to_uint64(pmt::tuple_ref(value, 0)),
+ // pmt::to_double(pmt::tuple_ref(value, 1)));
+ uint64_t seconds = pmt::to_uint64(pmt::tuple_ref(value, 0));
+ double fractional = pmt::to_double(pmt::tuple_ref(value, 1));
+
+ std::cerr << "TX_TIME: " << seconds << ":" << fractional << std::endl;
+ }
+ } // end for
+
+ if (found_time_tag) {
+ //_metadata.has_time_spec = true;
+ }
+}
+
+int xtrx_sink_c::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ int ninput_items = noutput_items;
+ const uint64_t samp0_count = nitems_read(0);
+ get_tags_in_range(_tags, 0, samp0_count, samp0_count + ninput_items);
+ if (!_tags.empty())
+ tag_process(ninput_items);
+
+ xtrx_send_ex_info_t nfo;
+ nfo.samples = noutput_items;
+ nfo.buffer_count = input_items.size();
+ nfo.buffers = &input_items[0];
+ nfo.flags = XTRX_TX_DONT_BUFFER;
+ if (!_allow_dis)
+ nfo.flags |= XTRX_TX_NO_DISCARD;
+ nfo.ts = _ts;
+ nfo.timeout = 0;
+
+ int res = xtrx_send_sync_ex(_xtrx->dev(), &nfo);
+ if (res) {
+ std::cerr << "Err: " << res << std::endl;
+
+ std::stringstream message;
+ message << "xtrx_send_burst_sync error: " << -res;
+ throw std::runtime_error( message.str() );
+ }
+
+ _ts += noutput_items;
+ for (unsigned i = 0; i < input_items.size(); i++) {
+ consume(i, noutput_items);
+ }
+ return 0;
+}
+
+bool xtrx_sink_c::start()
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+
+ xtrx_run_params_t params;
+ xtrx_run_params_init(&params);
+
+ params.dir = XTRX_TX;
+ if (!_mimo_mode)
+ params.tx.flags |= XTRX_RSP_SISO_MODE;
+
+ if (_swap_ab)
+ params.tx.flags |= XTRX_RSP_SWAP_AB;
+
+ if (_swap_iq)
+ params.tx.flags |= XTRX_RSP_SWAP_IQ;
+
+ params.tx.hfmt = XTRX_IQ_FLOAT32;
+ params.tx.wfmt = _otw;
+ params.tx.chs = XTRX_CH_AB;
+ params.tx.paketsize = 0;
+ params.rx_stream_start = 256*1024;
+
+ int res = xtrx_run_ex(_xtrx->dev(), &params);
+ if (res) {
+ std::cerr << "Got error: " << res << std::endl;
+ }
+
+ return res == 0;
+}
+
+bool xtrx_sink_c::stop()
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+
+ //TODO:
+ std::cerr << "xtrx_sink_c::stop()" << std::endl;
+ int res = xtrx_stop(_xtrx->dev(), XTRX_TX);
+ if (res) {
+ std::cerr << "Got error: " << res << std::endl;
+ }
+
+ return res == 0;
+}
diff --git a/lib/xtrx/xtrx_sink_c.h b/lib/xtrx/xtrx_sink_c.h
new file mode 100644
index 0000000..e923900
--- /dev/null
+++ b/lib/xtrx/xtrx_sink_c.h
@@ -0,0 +1,129 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2016 Sergey Kostanabev <sergey.kostanbaev@fairwaves.co>
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef XTRX_SINK_C_H
+#define XTRX_SINK_C_H
+
+#include <gnuradio/block.h>
+#include <gnuradio/sync_block.h>
+
+#include "sink_iface.h"
+#include "xtrx_obj.h"
+
+
+static const pmt::pmt_t SOB_KEY = pmt::string_to_symbol("tx_sob");
+static const pmt::pmt_t EOB_KEY = pmt::string_to_symbol("tx_eob");
+static const pmt::pmt_t TIME_KEY = pmt::string_to_symbol("tx_time");
+static const pmt::pmt_t FREQ_KEY = pmt::string_to_symbol("tx_freq");
+static const pmt::pmt_t COMMAND_KEY = pmt::string_to_symbol("tx_command");
+
+class xtrx_sink_c;
+
+typedef std::shared_ptr< xtrx_sink_c > xtrx_sink_c_sptr;
+
+xtrx_sink_c_sptr make_xtrx_sink_c( const std::string & args = "" );
+
+class xtrx_sink_c :
+ public gr::sync_block,
+ public sink_iface
+{
+private:
+ friend xtrx_sink_c_sptr make_xtrx_sink_c(const std::string &args);
+
+ xtrx_sink_c(const std::string &args);
+
+public:
+ ~xtrx_sink_c();
+
+ std::string name();
+
+ static std::vector< std::string > get_devices( bool fake = false ) { return xtrx_obj::get_devices(); }
+
+ size_t get_num_channels( void );
+
+ osmosdr::meta_range_t get_sample_rates( void );
+ double set_sample_rate( double rate );
+ double get_sample_rate( void );
+
+ osmosdr::freq_range_t get_freq_range( size_t chan = 0 );
+ double set_center_freq( double freq, size_t chan = 0 );
+ double get_center_freq( size_t chan = 0 );
+ double set_freq_corr( double ppm, size_t chan = 0 );
+ double get_freq_corr( size_t chan = 0 );
+
+ std::vector<std::string> get_gain_names( size_t chan = 0 );
+ osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
+ osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
+ bool set_gain_mode( bool automatic, size_t chan = 0 );
+ bool get_gain_mode( size_t chan = 0 );
+ double set_gain( double gain, size_t chan = 0 );
+ double set_gain( double gain, const std::string & name, size_t chan = 0 );
+ double get_gain( size_t chan = 0 );
+ double get_gain( const std::string & name, size_t chan = 0 );
+
+ std::vector< std::string > get_antennas( size_t chan = 0 );
+ std::string set_antenna( const std::string & antenna, size_t chan = 0 );
+ std::string get_antenna( size_t chan = 0 );
+
+ double set_bandwidth( double bandwidth, size_t chan = 0 );
+ double get_bandwidth( size_t chan = 0 );
+
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+ bool start();
+ bool stop();
+
+ void tag_process(int ninput_items);
+
+private:
+ xtrx_obj_sptr _xtrx;
+ std::vector<gr::tag_t> _tags;
+
+ unsigned _sample_flags;
+ double _rate;
+ double _master;
+ double _freq;
+ double _corr;
+ double _bandwidth;
+ double _dsp;
+ bool _auto_gain;
+
+ xtrx_wire_format_t _otw;
+ bool _mimo_mode;
+
+ int _gain_tx;
+
+ unsigned _channels;
+ xtrx_antenna_t _ant;
+
+ uint64_t _ts;
+
+ bool _swap_ab;
+ bool _swap_iq;
+
+ bool _tdd;
+ bool _allow_dis;
+
+ std::string _dev;
+};
+
+#endif // xtrx_sink_c_H
diff --git a/lib/xtrx/xtrx_source_c.cc b/lib/xtrx/xtrx_source_c.cc
new file mode 100644
index 0000000..4fdc877
--- /dev/null
+++ b/lib/xtrx/xtrx_source_c.cc
@@ -0,0 +1,583 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2016,2017 Sergey Kostanbaev <sergey.kostanbaev@fairwaves.co>
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#include <fstream>
+#include <string>
+#include <sstream>
+#include <map>
+
+#include <boost/assign.hpp>
+#include <boost/algorithm/string.hpp>
+#include <boost/thread.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+
+#include <gnuradio/io_signature.h>
+#include <gnuradio/blocks/deinterleave.h>
+#include <gnuradio/blocks/float_to_complex.h>
+
+#include "xtrx_source_c.h"
+
+#include "arg_helpers.h"
+
+using namespace boost::assign;
+
+
+xtrx_source_c_sptr make_xtrx_source_c(const std::string &args)
+{
+ return gnuradio::get_initial_sptr(new xtrx_source_c(args));
+}
+
+static size_t parse_nchan(const std::string &args)
+{
+ size_t nchan = 1;
+
+ dict_t dict = params_to_dict(args);
+
+ if (dict.count("nchan"))
+ nchan = boost::lexical_cast< size_t >( dict["nchan"] );
+
+ if (nchan < 1)
+ nchan = 1;
+
+ return nchan;
+}
+
+xtrx_source_c::xtrx_source_c(const std::string &args) :
+ gr::sync_block("xtrx_source_c",
+ gr::io_signature::make(0, 0, 0),
+ gr::io_signature::make(parse_nchan(args),
+ parse_nchan(args),
+ sizeof(gr_complex))),
+ _sample_flags(0),
+ _rate(0),
+ _master(0),
+ _freq(0),
+ _corr(0),
+ _bandwidth(0),
+ _auto_gain(false),
+ _otw(XTRX_WF_16),
+ _mimo_mode(false),
+ _gain_lna(0),
+ _gain_tia(0),
+ _gain_pga(0),
+ _channels(parse_nchan(args)),
+ _swap_ab(false),
+ _swap_iq(false),
+ _loopback(false),
+ _tdd(false),
+ _fbctrl(false),
+ _timekey(false),
+ _dsp(0)
+{
+ _id = pmt::string_to_symbol(args);
+
+ dict_t dict = params_to_dict(args);
+
+ if (dict.count("otw_format")) {
+ const std::string& otw = dict["otw_format"];
+ if (otw == "sc16" || otw == "16") {
+ _otw = XTRX_WF_16;
+ } else if (otw == "sc12" || otw == "12") {
+ _otw = XTRX_WF_12;
+ } else if (otw == "sc8" || otw == "8") {
+ _otw = XTRX_WF_8;
+ } else {
+ throw std::runtime_error("Parameter `otw_format` should be {sc16,sc12,sc8}");
+ }
+ }
+
+ if (dict.count("master")) {
+ _master = boost::lexical_cast< double >( dict["master"]);
+ }
+
+ std::cerr << args.c_str() << std::endl;
+
+ int loglevel = 4;
+ if (dict.count("loglevel")) {
+ loglevel = boost::lexical_cast< int >( dict["loglevel"] );
+ }
+
+ bool lmsreset = 0;
+ if (dict.count("lmsreset")) {
+ lmsreset = boost::lexical_cast< bool >( dict["lmsreset"] );
+ }
+
+ if (dict.count("fbctrl")) {
+ _fbctrl = boost::lexical_cast< bool >( dict["fbctrl"] );
+ }
+
+ if (dict.count("swap_ab")) {
+ _swap_ab = true;
+ std::cerr << "xtrx_source_c: swap AB channels";
+ }
+
+ if (dict.count("swap_iq")) {
+ _swap_iq = true;
+ std::cerr << "xtrx_source_c: swap IQ";
+ }
+
+ if (dict.count("sfl")) {
+ _sample_flags = boost::lexical_cast< unsigned >( dict["sfl"] );
+ }
+
+ if (dict.count("loopback")) {
+ _loopback = true;
+ std::cerr << "xtrx_source_c: loopback";
+ }
+
+ if (dict.count("tdd")) {
+ _tdd = true;
+ std::cerr << "xtrx_source_c: TDD mode";
+ }
+
+ if (dict.count("dsp")) {
+ _dsp = boost::lexical_cast< double >( dict["dsp"] );
+ std::cerr << "xtrx_source_c: DSP:" << _dsp;
+ }
+
+ if (dict.count("dev")) {
+ _dev = dict["dev"];
+ std::cerr << "xtrx_source_c: XTRX device: %s" << _dev.c_str();
+ }
+
+ _xtrx = xtrx_obj::get(_dev.c_str(), loglevel, lmsreset);
+ if (_xtrx->dev_count() * 2 == _channels) {
+ _mimo_mode = true;
+ } else if (_xtrx->dev_count() != _channels) {
+ throw std::runtime_error("Number of requested channels != number of devices");
+ }
+
+ if (dict.count("refclk")) {
+ xtrx_set_ref_clk(_xtrx->dev(), boost::lexical_cast< unsigned >( dict["refclk"] ), XTRX_CLKSRC_INT);
+ }
+ if (dict.count("extclk")) {
+ xtrx_set_ref_clk(_xtrx->dev(), boost::lexical_cast< unsigned >( dict["extclk"] ), XTRX_CLKSRC_EXT);
+ }
+
+ if (dict.count("vio")) {
+ unsigned vio = boost::lexical_cast< unsigned >( dict["vio"] );
+ _xtrx->set_vio(vio);
+ }
+
+ if (dict.count("dac")) {
+ unsigned dac = boost::lexical_cast< unsigned >( dict["dac"] );
+ xtrx_val_set(_xtrx->dev(), XTRX_TRX, XTRX_CH_ALL, XTRX_VCTCXO_DAC_VAL, dac);
+ }
+
+ if (dict.count("pmode")) {
+ unsigned pmode = boost::lexical_cast< unsigned >( dict["pmode"] );
+ xtrx_val_set(_xtrx->dev(), XTRX_TRX, XTRX_CH_ALL, XTRX_LMS7_PWR_MODE, pmode);
+ }
+
+ if (dict.count("timekey")) {
+ _timekey = boost::lexical_cast< bool >( dict["timekey"] );
+ }
+
+ std::cerr << "xtrx_source_c::xtrx_source_c()" << std::endl;
+ set_alignment(32);
+ if (_otw == XTRX_WF_16) {
+ if (_mimo_mode)
+ set_output_multiple(4096);
+ else
+ set_output_multiple(8192);
+ } else if (_otw == XTRX_WF_8) {
+ if (_mimo_mode)
+ set_output_multiple(8192);
+ else
+ set_output_multiple(16384);
+ }
+}
+
+xtrx_source_c::~xtrx_source_c()
+{
+ std::cerr << "xtrx_source_c::~xtrx_source_c()" << std::endl;
+}
+
+std::string xtrx_source_c::name()
+{
+ return "GrLibXTRX";
+}
+
+size_t xtrx_source_c::get_num_channels( void )
+{
+ return output_signature()->max_streams();
+}
+
+osmosdr::meta_range_t xtrx_source_c::get_sample_rates( void )
+{
+ osmosdr::meta_range_t range;
+ range += osmosdr::range_t( 200000, 160000000, 1 );
+ return range;
+}
+
+double xtrx_source_c::set_sample_rate( double rate )
+{
+ std::cerr << "Set sample rate " << rate << std::endl;
+ _rate = _xtrx->set_smaplerate(rate, _master, false, _sample_flags);
+ return get_sample_rate();
+}
+
+double xtrx_source_c::get_sample_rate( void )
+{
+ return _rate;
+}
+
+osmosdr::freq_range_t xtrx_source_c::get_freq_range( size_t chan )
+{
+ osmosdr::freq_range_t range;
+ range += osmosdr::range_t( double(0.03e9), double(3.8e9), 1); // as far as we know
+ return range;
+}
+
+double xtrx_source_c::set_center_freq( double freq, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+
+ _freq = freq;
+ double corr_freq = (freq)*(1.0 + (_corr) * 0.000001);
+
+ if (_tdd)
+ return get_center_freq(chan);
+
+ xtrx_channel_t xchan = (xtrx_channel_t)(XTRX_CH_A << chan);
+
+ std::cerr << "Set freq " << freq << std::endl;
+
+ int res = xtrx_tune_ex(_xtrx->dev(), XTRX_TUNE_RX_FDD, xchan, corr_freq - _dsp, &_freq);
+ if (res) {
+ std::cerr << "Unable to deliver frequency " << corr_freq << std::endl;
+ }
+
+ res = xtrx_tune_ex(_xtrx->dev(), XTRX_TUNE_BB_RX, xchan, _dsp, NULL);
+
+ return get_center_freq(chan);
+}
+
+double xtrx_source_c::get_center_freq( size_t chan )
+{
+ return _freq;
+}
+
+double xtrx_source_c::set_freq_corr( double ppm, size_t chan )
+{
+ _corr = ppm;
+
+ set_center_freq(_freq, chan);
+
+ return get_freq_corr( chan );
+}
+
+double xtrx_source_c::get_freq_corr( size_t chan )
+{
+ return _corr;
+}
+
+static const std::map<std::string, xtrx_gain_type_t> s_lna_map = boost::assign::map_list_of
+ ("LNA", XTRX_RX_LNA_GAIN)
+ ("TIA", XTRX_RX_TIA_GAIN)
+ ("PGA", XTRX_RX_PGA_GAIN)
+ ("LB", XTRX_RX_LB_GAIN)
+ ;
+
+static xtrx_gain_type_t get_gain_type(const std::string& name)
+{
+ std::map<std::string, xtrx_gain_type_t>::const_iterator it;
+
+ it = s_lna_map.find(name);
+ if (it != s_lna_map.end()) {
+ return it->second;
+ }
+
+ return XTRX_RX_LNA_GAIN;
+}
+
+static const std::vector<std::string> s_lna_list = boost::assign::list_of
+ ("LNA")("TIA")("PGA")("LB")
+ ;
+
+std::vector<std::string> xtrx_source_c::get_gain_names( size_t chan )
+{
+ return s_lna_list;
+}
+
+osmosdr::gain_range_t xtrx_source_c::get_gain_range( size_t chan )
+{
+ return get_gain_range("LNA", chan);
+}
+
+osmosdr::gain_range_t xtrx_source_c::get_gain_range( const std::string & name, size_t chan )
+{
+ osmosdr::gain_range_t range;
+
+ if (name == "LNA") {
+ range += osmosdr::range_t( 0, 24, 3 );
+ range += osmosdr::range_t( 25, 30, 1 );
+ } else if (name == "TIA") {
+ range += osmosdr::range_t( 0 );
+ range += osmosdr::range_t( 9 );
+ range += osmosdr::range_t( 12 );
+ } else if (name == "PGA") {
+ range += osmosdr::range_t( -12.5, 12.5, 1 );
+ } else if (name == "LB") {
+ range += osmosdr::range_t( -40, 0, 1 );
+ }
+
+ return range;
+}
+
+bool xtrx_source_c::set_gain_mode( bool automatic, size_t chan )
+{
+ _auto_gain = automatic;
+ return get_gain_mode(chan);
+}
+
+bool xtrx_source_c::get_gain_mode( size_t chan )
+{
+ return _auto_gain;
+}
+
+double xtrx_source_c::set_gain( double gain, size_t chan )
+{
+ return set_gain(gain, "LNA", chan);
+}
+
+double xtrx_source_c::set_gain( double igain, const std::string & name, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+
+ osmosdr::gain_range_t gains = xtrx_source_c::get_gain_range( name, chan );
+ double gain = gains.clip(igain);
+ double actual_gain;
+ xtrx_gain_type_t gt = get_gain_type(name);
+
+ std::cerr << "Set gain " << name << " (" << gt << "): " << igain << std::endl;
+
+ int res = xtrx_set_gain(_xtrx->dev(), (xtrx_channel_t)(XTRX_CH_A << chan),
+ gt, gain, &actual_gain);
+ if (res) {
+ std::cerr << "Unable to set gain `" << name.c_str() << "`; err=" << res << std::endl;
+ }
+
+ switch (gt) {
+ case XTRX_RX_LNA_GAIN: _gain_lna = actual_gain; break;
+ case XTRX_RX_TIA_GAIN: _gain_tia = actual_gain; break;
+ case XTRX_RX_PGA_GAIN: _gain_pga = actual_gain; break;
+ default: break;
+ }
+
+ return actual_gain;
+}
+
+double xtrx_source_c::get_gain( size_t chan )
+{
+ return get_gain("LNA");
+}
+
+double xtrx_source_c::get_gain( const std::string & name, size_t chan )
+{
+ xtrx_gain_type_t gt = get_gain_type(name);
+ switch (gt) {
+ case XTRX_RX_LNA_GAIN: return _gain_lna;
+ case XTRX_RX_TIA_GAIN: return _gain_tia;
+ case XTRX_RX_PGA_GAIN: return _gain_pga;
+ default: return 0;
+ }
+}
+
+double xtrx_source_c::set_if_gain(double gain, size_t chan)
+{
+ return set_gain(gain, "PGA", chan);
+}
+
+double xtrx_source_c::set_bandwidth( double bandwidth, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+ std::cerr << "Set bandwidth " << bandwidth << " chan " << chan << std::endl;
+
+ if (bandwidth <= 0.0) {
+ bandwidth = get_sample_rate() * 0.75;
+ if (bandwidth < 0.5e6) {
+ bandwidth = 0.5e6;
+ }
+ }
+
+ int res = xtrx_tune_rx_bandwidth(_xtrx->dev(), (xtrx_channel_t)(XTRX_CH_A << chan),
+ bandwidth, &_bandwidth);
+ if (res) {
+ std::cerr << "Can't set bandwidth: " << res << std::endl;
+ }
+ return get_bandwidth(chan);
+}
+
+double xtrx_source_c::get_bandwidth( size_t chan )
+{
+ return _bandwidth;
+}
+
+osmosdr::freq_range_t xtrx_source_c::get_bandwidth_range( size_t chan )
+{
+ return osmosdr::freq_range_t(500e3, 140e6, 0);
+}
+
+
+static const std::map<std::string, xtrx_antenna_t> s_ant_map = boost::assign::map_list_of
+ ("AUTO", XTRX_RX_AUTO)
+ ("RXL", XTRX_RX_L)
+ ("RXH", XTRX_RX_H)
+ ("RXW", XTRX_RX_W)
+ ("RXL_LB", XTRX_RX_L_LB)
+ ("RXW_LB", XTRX_RX_W_LB)
+ ;
+static const std::map<xtrx_antenna_t, std::string> s_ant_map_r = boost::assign::map_list_of
+ (XTRX_RX_AUTO, "AUTO")
+ (XTRX_RX_L, "RXL")
+ (XTRX_RX_H, "RXH")
+ (XTRX_RX_W, "RXW")
+ (XTRX_RX_L_LB, "RXL_LB")
+ (XTRX_RX_W_LB, "RXW_LB")
+ ;
+
+static xtrx_antenna_t get_ant_type(const std::string& name)
+{
+ std::map<std::string, xtrx_antenna_t>::const_iterator it;
+
+ it = s_ant_map.find(name);
+ if (it != s_ant_map.end()) {
+ return it->second;
+ }
+
+ return XTRX_RX_AUTO;
+}
+
+static const std::vector<std::string> s_ant_list = boost::assign::list_of
+ ("AUTO")("RXL")("RXH")("RXW")
+ ;
+
+
+std::vector< std::string > xtrx_source_c::get_antennas( size_t chan )
+{
+ return s_ant_list;
+}
+
+std::string xtrx_source_c::set_antenna( const std::string & antenna, size_t chan )
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+ _ant = get_ant_type(antenna);
+
+ std::cerr << "Set antenna " << antenna << " type:" << _ant << std::endl;
+
+ int res = xtrx_set_antenna_ex(_xtrx->dev(), (xtrx_channel_t)(XTRX_CH_A << chan),
+ _ant);
+ if (res) {
+ std::cerr << "Can't set antenna: " << antenna << std::endl;
+ }
+ return get_antenna( chan );
+}
+
+std::string xtrx_source_c::get_antenna( size_t chan )
+{
+ return s_ant_map_r.find(_ant)->second;
+}
+
+int xtrx_source_c::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ xtrx_recv_ex_info_t ri;
+ ri.samples = noutput_items;
+ ri.buffer_count = output_items.size();
+ ri.buffers = &output_items[0];
+ ri.flags = RCVEX_DONT_INSER_ZEROS | RCVEX_DROP_OLD_ON_OVERFLOW;
+ ri.timeout = 1000;
+
+ int res = xtrx_recv_sync_ex(_xtrx->dev(), &ri);
+ if (res) {
+ std::stringstream message;
+ message << "xtrx_recv_sync error: " << -res;
+ throw std::runtime_error( message.str() );
+ }
+
+ if (_timekey) {
+ uint64_t seconds = (ri.out_first_sample / _rate);
+ double fractional = (ri.out_first_sample - (uint64_t)(_rate * seconds)) / _rate;
+
+ //std::cerr << "Time " << seconds << ":" << fractional << std::endl;
+ const pmt::pmt_t val = pmt::make_tuple
+ (pmt::from_uint64(seconds),
+ pmt::from_double(fractional));
+ for(size_t i = 0; i < output_items.size(); i++) {
+ this->add_item_tag(i, nitems_written(0), TIME_KEY,
+ val, _id);
+ this->add_item_tag(i, nitems_written(0), RATE_KEY,
+ pmt::from_double(_rate), _id);
+ this->add_item_tag(i, nitems_written(0), FREQ_KEY,
+ pmt::from_double(this->get_center_freq(i)), _id);
+ }
+ }
+ return ri.out_samples;
+}
+
+bool xtrx_source_c::start()
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+
+ xtrx_run_params_t params;
+ xtrx_run_params_init(&params);
+
+ params.dir = XTRX_RX;
+ if (!_mimo_mode)
+ params.rx.flags |= XTRX_RSP_SISO_MODE;
+
+ if (_swap_ab)
+ params.rx.flags |= XTRX_RSP_SWAP_AB;
+
+ if (_swap_iq)
+ params.rx.flags |= XTRX_RSP_SWAP_IQ;
+
+ params.rx.hfmt = XTRX_IQ_FLOAT32;
+ params.rx.wfmt = _otw;
+ params.rx.chs = XTRX_CH_AB;
+ params.rx.paketsize = 0;
+ params.rx_stream_start = 256*1024;
+
+ params.nflags = (_loopback) ? XTRX_RUN_DIGLOOPBACK : 0;
+
+ int res = xtrx_run_ex(_xtrx->dev(), &params);
+ if (res) {
+ std::cerr << "Got error: " << res << std::endl;
+ }
+
+ res = xtrx_tune_ex(_xtrx->dev(), XTRX_TUNE_BB_RX, XTRX_CH_ALL, _dsp, NULL);
+
+ return res == 0;
+}
+
+bool xtrx_source_c::stop()
+{
+ boost::mutex::scoped_lock lock(_xtrx->mtx);
+ //TODO:
+ std::cerr << "xtrx_source_c::stop()" << std::endl;
+ int res = xtrx_stop(_xtrx->dev(), XTRX_RX);
+ if (res) {
+ std::cerr << "Got error: " << res << std::endl;
+ }
+
+ return res == 0;
+}
diff --git a/lib/xtrx/xtrx_source_c.h b/lib/xtrx/xtrx_source_c.h
new file mode 100644
index 0000000..6ec2fb2
--- /dev/null
+++ b/lib/xtrx/xtrx_source_c.h
@@ -0,0 +1,127 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2016,2017 Sergey Kostanbaev <sergey.kostanbaev@fairwaves.co>
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+#ifndef XTRX_SOURCE_C_H
+#define XTRX_SOURCE_C_H
+
+#include <gnuradio/block.h>
+#include <gnuradio/sync_block.h>
+
+#include "source_iface.h"
+#include "xtrx_obj.h"
+
+static const pmt::pmt_t TIME_KEY = pmt::string_to_symbol("rx_time");
+static const pmt::pmt_t RATE_KEY = pmt::string_to_symbol("rx_rate");
+static const pmt::pmt_t FREQ_KEY = pmt::string_to_symbol("rx_freq");
+
+class xtrx_source_c;
+
+typedef std::shared_ptr< xtrx_source_c > xtrx_source_c_sptr;
+
+xtrx_source_c_sptr make_xtrx_source_c( const std::string & args = "" );
+
+class xtrx_source_c :
+ public gr::sync_block,
+ public source_iface
+{
+private:
+ friend xtrx_source_c_sptr make_xtrx_source_c(const std::string &args);
+
+ xtrx_source_c(const std::string &args);
+
+public:
+ ~xtrx_source_c();
+
+ std::string name();
+
+ static std::vector< std::string > get_devices( bool fake = false ) { return xtrx_obj::get_devices(); }
+
+ size_t get_num_channels( void );
+
+ osmosdr::meta_range_t get_sample_rates( void );
+ double set_sample_rate( double rate );
+ double get_sample_rate( void );
+
+ osmosdr::freq_range_t get_freq_range( size_t chan = 0 );
+ double set_center_freq( double freq, size_t chan = 0 );
+ double get_center_freq( size_t chan = 0 );
+ double set_freq_corr( double ppm, size_t chan = 0 );
+ double get_freq_corr( size_t chan = 0 );
+
+ std::vector<std::string> get_gain_names( size_t chan = 0 );
+ osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
+ osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
+ bool set_gain_mode( bool automatic, size_t chan = 0 );
+ bool get_gain_mode( size_t chan = 0 );
+ double set_gain( double gain, size_t chan = 0 );
+ double set_gain( double gain, const std::string & name, size_t chan = 0 );
+ double get_gain( size_t chan = 0 );
+ double get_gain( const std::string & name, size_t chan = 0 );
+
+ double set_if_gain( double gain, size_t chan = 0 );
+
+ std::vector< std::string > get_antennas( size_t chan = 0 );
+ std::string set_antenna( const std::string & antenna, size_t chan = 0 );
+ std::string get_antenna( size_t chan = 0 );
+
+ double set_bandwidth( double bandwidth, size_t chan = 0 );
+ double get_bandwidth( size_t chan = 0 );
+ osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0);
+
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+ bool start();
+ bool stop();
+
+private:
+ xtrx_obj_sptr _xtrx;
+ pmt::pmt_t _id;
+
+ unsigned _sample_flags;
+ double _rate;
+ double _master;
+ double _freq;
+ double _corr;
+ double _bandwidth;
+ bool _auto_gain;
+
+ xtrx_wire_format_t _otw;
+ bool _mimo_mode;
+
+ int _gain_lna;
+ int _gain_tia;
+ int _gain_pga;
+
+ unsigned _channels;
+ xtrx_antenna_t _ant;
+
+ bool _swap_ab;
+ bool _swap_iq;
+ bool _loopback;
+ bool _tdd;
+ bool _fbctrl;
+ bool _timekey;
+
+ double _dsp;
+ std::string _dev;
+};
+
+#endif // XTRX_SOURCE_C_H
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 8841f36..dcae02a 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,21 +1,10 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gr-osmosdr
#
-# GNU Radio 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, or (at your option)
-# any later version.
+# SPDX-License-Identifier: GPL-3.0-or-later
#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
########################################################################
# Include python install macros
@@ -25,6 +14,8 @@ if(NOT PYTHONINTERP_FOUND)
return()
endif()
+add_subdirectory(bindings)
+
########################################################################
# Install python sources
########################################################################
@@ -40,4 +31,3 @@ GR_PYTHON_INSTALL(
include(GrTest)
set(GR_TEST_TARGET_DEPS gnuradio-osmosdr)
-set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig)
diff --git a/python/__init__.py b/python/__init__.py
index c7310e1..e619f4f 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -1,29 +1,24 @@
#
# Copyright 2008,2009 Free Software Foundation, Inc.
#
-# This application 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, or (at your option)
-# any later version.
-#
-# This application 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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# SPDX-License-Identifier: GPL-3.0-or-later
#
# The presence of this file turns this directory into a Python package
'''
-This is the GNU Radio OsmoSDR module.
+This is the GNU Radio OSMOSDR module. Place your Python package
+description here (python/__init__.py).
'''
+import os
-# import swig generated symbols into the osmosdr namespace
-from osmosdr_swig import *
+# import pybind11 generated symbols into the osmosdr namespace
+try:
+ from .osmosdr_python import *
+except ImportError:
+ dirname, filename = os.path.split(os.path.abspath(__file__))
+ __path__.append(os.path.join(dirname, "bindings"))
+ from .osmosdr_python import *
# import any pure python here
#
diff --git a/python/bindings/CMakeLists.txt b/python/bindings/CMakeLists.txt
new file mode 100644
index 0000000..f2233cf
--- /dev/null
+++ b/python/bindings/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Copyright 2020 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+
+GR_PYTHON_CHECK_MODULE_RAW(
+ "pygccxml"
+ "import pygccxml"
+ PYGCCXML_FOUND
+ )
+
+include(GrPybind)
+
+########################################################################
+# Python Bindings
+########################################################################
+
+list(APPEND osmosdr_python_files
+ device_python.cc
+ sink_python.cc
+ source_python.cc
+ ranges_python.cc
+ time_spec_python.cc
+ python_bindings.cc)
+
+GR_PYBIND_MAKE_OOT(osmosdr
+ ../..
+ gr::osmosdr
+ "${osmosdr_python_files}")
+
+install(TARGETS osmosdr_python DESTINATION ${GR_PYTHON_DIR}/osmosdr COMPONENT pythonapi)
diff --git a/python/bindings/README.md b/python/bindings/README.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/python/bindings/README.md
diff --git a/python/bindings/bind_oot_file.py b/python/bindings/bind_oot_file.py
new file mode 100644
index 0000000..55de795
--- /dev/null
+++ b/python/bindings/bind_oot_file.py
@@ -0,0 +1,53 @@
+import warnings
+import argparse
+import os
+from gnuradio.bindtool import BindingGenerator
+import pathlib
+import sys
+
+parser = argparse.ArgumentParser(description='Bind a GR Out of Tree Block')
+parser.add_argument('--module', type=str,
+ help='Name of gr module containing file to bind (e.g. fft digital analog)')
+
+parser.add_argument('--output_dir', default='/tmp',
+ help='Output directory of generated bindings')
+parser.add_argument('--prefix', help='Prefix of Installed GNU Radio')
+parser.add_argument('--src', help='Directory of gnuradio source tree',
+ default=os.path.dirname(os.path.abspath(__file__))+'/../../..')
+
+parser.add_argument(
+ '--filename', help="File to be parsed")
+
+parser.add_argument(
+ '--include', help='Additional Include Dirs, separated', default=(), nargs='+')
+
+parser.add_argument(
+ '--status', help='Location of output file for general status (used during cmake)', default=None
+)
+parser.add_argument(
+ '--flag_automatic', default='0'
+)
+parser.add_argument(
+ '--flag_pygccxml', default='0'
+)
+
+args = parser.parse_args()
+
+prefix = args.prefix
+output_dir = args.output_dir
+includes = args.include
+name = args.module
+
+namespace = [name]
+prefix_include_root = name
+
+
+with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
+
+ bg = BindingGenerator(prefix, namespace,
+ prefix_include_root, output_dir, addl_includes=','.join(args.include), catch_exceptions=False, write_json_output=False, status_output=args.status,
+ flag_automatic=True if args.flag_automatic.lower() in [
+ '1', 'true'] else False,
+ flag_pygccxml=True if args.flag_pygccxml.lower() in ['1', 'true'] else False)
+ bg.gen_file_binding(args.filename)
diff --git a/python/bindings/device_python.cc b/python/bindings/device_python.cc
new file mode 100644
index 0000000..f82a48f
--- /dev/null
+++ b/python/bindings/device_python.cc
@@ -0,0 +1,27 @@
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+
+namespace py = pybind11;
+
+#include <osmosdr/device.h>
+
+void bind_device(py::module& m)
+{
+ using device_t = ::osmosdr::device_t;
+
+ py::class_<device_t>(m, "device_t")
+ .def(py::init<std::string&>(), py::arg("args") = "")
+ .def("to_pp_string", &device_t::to_pp_string)
+ .def("to_string", &device_t::to_string);
+
+
+ using devices_t = ::osmosdr::devices_t;
+
+ py::class_<devices_t>(m, "devices_t");
+
+
+ using device = ::osmosdr::device;
+
+ py::class_<device>(m, "device")
+ .def_static("find", &device::find, py::arg("hint") = device_t());
+}
diff --git a/python/bindings/docstrings/README.md b/python/bindings/docstrings/README.md
new file mode 100644
index 0000000..295455a
--- /dev/null
+++ b/python/bindings/docstrings/README.md
@@ -0,0 +1 @@
+This directory stores templates for docstrings that are scraped from the include header files for each block \ No newline at end of file
diff --git a/python/bindings/docstrings/sink_pydoc_template.h b/python/bindings/docstrings/sink_pydoc_template.h
new file mode 100644
index 0000000..504105f
--- /dev/null
+++ b/python/bindings/docstrings/sink_pydoc_template.h
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+#include "pydoc_macros.h"
+#define D(...) DOC(osmosdr, __VA_ARGS__ )
+/*
+ This file contains placeholders for docstrings for the Python bindings.
+ Do not edit! These were automatically extracted during the binding process
+ and will be overwritten during the build process
+ */
+
+
+
+ static const char *__doc_osmosdr_sink = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_sink_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_sink_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_make = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_num_channels = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_sample_rates = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_sample_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_sample_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_freq_range = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_center_freq = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_center_freq = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_freq_corr = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_freq_corr = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_gain_names = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_gain_range_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_gain_range_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_gain_mode = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_gain_mode = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_gain_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_gain_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_gain_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_gain_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_if_gain = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_bb_gain = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_antennas = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_antenna = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_antenna = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_dc_offset = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_iq_balance = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_bandwidth = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_bandwidth = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_bandwidth_range = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_time_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_time_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_time_sources = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_clock_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_clock_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_clock_sources = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_clock_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_clock_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_time_now = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_get_time_last_pps = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_time_now = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_time_next_pps = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_sink_set_time_unknown_pps = R"doc()doc";
+
+
diff --git a/python/bindings/docstrings/source_pydoc_template.h b/python/bindings/docstrings/source_pydoc_template.h
new file mode 100644
index 0000000..17aae8e
--- /dev/null
+++ b/python/bindings/docstrings/source_pydoc_template.h
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+#include "pydoc_macros.h"
+#define D(...) DOC(osmosdr, __VA_ARGS__ )
+/*
+ This file contains placeholders for docstrings for the Python bindings.
+ Do not edit! These were automatically extracted during the binding process
+ and will be overwritten during the build process
+ */
+
+
+
+ static const char *__doc_osmosdr_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_source_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_source_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_make = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_num_channels = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_seek = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_sample_rates = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_sample_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_sample_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_freq_range = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_center_freq = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_center_freq = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_freq_corr = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_freq_corr = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_gain_names = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_gain_range_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_gain_range_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_gain_mode = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_gain_mode = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_gain_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_gain_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_gain_0 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_gain_1 = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_if_gain = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_bb_gain = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_antennas = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_antenna = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_antenna = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_dc_offset_mode = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_dc_offset = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_iq_balance_mode = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_iq_balance = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_bandwidth = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_bandwidth = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_bandwidth_range = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_time_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_time_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_time_sources = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_clock_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_clock_source = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_clock_sources = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_clock_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_clock_rate = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_time_now = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_get_time_last_pps = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_time_now = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_time_next_pps = R"doc()doc";
+
+
+ static const char *__doc_osmosdr_source_set_time_unknown_pps = R"doc()doc";
+
+
diff --git a/python/bindings/header_utils.py b/python/bindings/header_utils.py
new file mode 100644
index 0000000..165124e
--- /dev/null
+++ b/python/bindings/header_utils.py
@@ -0,0 +1,78 @@
+# Utilities for reading values in header files
+
+from argparse import ArgumentParser
+import re
+
+
+class PybindHeaderParser:
+ def __init__(self, pathname):
+ with open(pathname,'r') as f:
+ self.file_txt = f.read()
+
+ def get_flag_automatic(self):
+ # p = re.compile(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)')
+ # m = p.search(self.file_txt)
+ m = re.search(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)', self.file_txt)
+ if (m and m.group(1) == '1'):
+ return True
+ else:
+ return False
+
+ def get_flag_pygccxml(self):
+ # p = re.compile(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)')
+ # m = p.search(self.file_txt)
+ m = re.search(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)', self.file_txt)
+ if (m and m.group(1) == '1'):
+ return True
+ else:
+ return False
+
+ def get_header_filename(self):
+ # p = re.compile(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)')
+ # m = p.search(self.file_txt)
+ m = re.search(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)', self.file_txt)
+ if (m):
+ return m.group(1)
+ else:
+ return None
+
+ def get_header_file_hash(self):
+ # p = re.compile(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)')
+ # m = p.search(self.file_txt)
+ m = re.search(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)', self.file_txt)
+ if (m):
+ return m.group(1)
+ else:
+ return None
+
+ def get_flags(self):
+ return f'{self.get_flag_automatic()};{self.get_flag_pygccxml()};{self.get_header_filename()};{self.get_header_file_hash()};'
+
+
+
+def argParse():
+ """Parses commandline args."""
+ desc='Reads the parameters from the comment block in the pybind files'
+ parser = ArgumentParser(description=desc)
+
+ parser.add_argument("function", help="Operation to perform on comment block of pybind file", choices=["flag_auto","flag_pygccxml","header_filename","header_file_hash","all"])
+ parser.add_argument("pathname", help="Pathname of pybind c++ file to read, e.g. blockname_python.cc")
+
+ return parser.parse_args()
+
+if __name__ == "__main__":
+ # Parse command line options and set up doxyxml.
+ args = argParse()
+
+ pbhp = PybindHeaderParser(args.pathname)
+
+ if args.function == "flag_auto":
+ print(pbhp.get_flag_automatic())
+ elif args.function == "flag_pygccxml":
+ print(pbhp.get_flag_pygccxml())
+ elif args.function == "header_filename":
+ print(pbhp.get_header_filename())
+ elif args.function == "header_file_hash":
+ print(pbhp.get_header_file_hash())
+ elif args.function == "all":
+ print(pbhp.get_flags()) \ No newline at end of file
diff --git a/python/bindings/python_bindings.cc b/python/bindings/python_bindings.cc
new file mode 100644
index 0000000..428417d
--- /dev/null
+++ b/python/bindings/python_bindings.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+#include <pybind11/pybind11.h>
+
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+#include <numpy/arrayobject.h>
+
+namespace py = pybind11;
+
+// Headers for binding functions
+/**************************************/
+// The following comment block is used for
+// gr_modtool to insert function prototypes
+// Please do not delete
+/**************************************/
+// BINDING_FUNCTION_PROTOTYPES(
+ void bind_sink(py::module& m);
+ void bind_source(py::module& m);
+// ) END BINDING_FUNCTION_PROTOTYPES
+
+void bind_device(py::module& m);
+void bind_ranges(py::module& m);
+void bind_time_spec(py::module& m);
+
+
+// We need this hack because import_array() returns NULL
+// for newer Python versions.
+// This function is also necessary because it ensures access to the C API
+// and removes a warning.
+void* init_numpy()
+{
+ import_array();
+ return NULL;
+}
+
+PYBIND11_MODULE(osmosdr_python, m)
+{
+ // Initialize the numpy C API
+ // (otherwise we will see segmentation faults)
+ init_numpy();
+
+ // Allow access to base block methods
+ py::module::import("gnuradio.gr");
+
+ /**************************************/
+ // The following comment block is used for
+ // gr_modtool to insert binding function calls
+ // Please do not delete
+ /**************************************/
+ // BINDING_FUNCTION_CALLS(
+ bind_sink(m);
+ bind_source(m);
+ // ) END BINDING_FUNCTION_CALLS
+
+ bind_device(m);
+ bind_ranges(m);
+ bind_time_spec(m);
+}
diff --git a/python/bindings/ranges_python.cc b/python/bindings/ranges_python.cc
new file mode 100644
index 0000000..fce957c
--- /dev/null
+++ b/python/bindings/ranges_python.cc
@@ -0,0 +1,35 @@
+#include <pybind11/pybind11.h>
+
+namespace py = pybind11;
+
+#include <osmosdr/ranges.h>
+
+void bind_ranges(py::module& m)
+{
+ m.attr("ALL_MBOARDS") = ::osmosdr::ALL_MBOARDS;
+ m.attr("ALL_CHANS") = ::osmosdr::ALL_CHANS;
+
+
+ using range_t = ::osmosdr::range_t;
+
+ py::class_<range_t>(m, "range_t")
+ .def(py::init<double>(), py::arg("value") = 0)
+ .def(py::init<double, double, double>(), py::arg("start"), py::arg("stop"), py::arg("step") = 0)
+ .def("start", &range_t::start)
+ .def("stop", &range_t::stop)
+ .def("step", &range_t::step)
+ .def("to_pp_string", &range_t::to_pp_string);
+
+
+ using meta_range_t = ::osmosdr::meta_range_t;
+
+ py::class_<meta_range_t>(m, "meta_range_t")
+ .def(py::init())
+ .def(py::init<double, double, double>(), py::arg("start"), py::arg("stop"), py::arg("step") = 0)
+ .def("start", &meta_range_t::start)
+ .def("stop", &meta_range_t::stop)
+ .def("step", &meta_range_t::step)
+ .def("clip", &meta_range_t::clip, py::arg("value"), py::arg("clip_step") = false)
+ .def("values", &meta_range_t::values)
+ .def("to_pp_string", &meta_range_t::to_pp_string);
+}
diff --git a/python/bindings/sink_python.cc b/python/bindings/sink_python.cc
new file mode 100644
index 0000000..1c6711d
--- /dev/null
+++ b/python/bindings/sink_python.cc
@@ -0,0 +1,320 @@
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+/***********************************************************************************/
+/* This file is automatically generated using bindtool and can be manually edited */
+/* The following lines can be configured to regenerate this file during cmake */
+/* If manual edits are made, the following tags should be modified accordingly. */
+/* BINDTOOL_GEN_AUTOMATIC(1) */
+/* BINDTOOL_USE_PYGCCXML(0) */
+/* BINDTOOL_HEADER_FILE(sink.h) */
+/* BINDTOOL_HEADER_FILE_HASH(d4331eb8a19b7a2aa4ed0100039f7a0e) */
+/***********************************************************************************/
+
+#include <pybind11/complex.h>
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+
+namespace py = pybind11;
+
+#include <osmosdr/sink.h>
+// pydoc.h is automatically generated in the build directory
+#include <sink_pydoc.h>
+
+void bind_sink(py::module& m)
+{
+
+ using sink = ::osmosdr::sink;
+
+
+ py::class_<sink, gr::hier_block2,
+ std::shared_ptr<sink>>(m, "sink", D(sink))
+
+ .def(py::init(&sink::make),
+ py::arg("args") = "",
+ D(sink,make)
+ )
+
+
+
+
+
+ .def("get_num_channels",&sink::get_num_channels,
+ D(sink,get_num_channels)
+ )
+
+
+ .def("get_sample_rates",&sink::get_sample_rates,
+ D(sink,get_sample_rates)
+ )
+
+
+ .def("set_sample_rate",&sink::set_sample_rate,
+ py::arg("rate"),
+ D(sink,set_sample_rate)
+ )
+
+
+ .def("get_sample_rate",&sink::get_sample_rate,
+ D(sink,get_sample_rate)
+ )
+
+
+ .def("get_freq_range",&sink::get_freq_range,
+ py::arg("chan") = 0,
+ D(sink,get_freq_range)
+ )
+
+
+ .def("set_center_freq",&sink::set_center_freq,
+ py::arg("freq"),
+ py::arg("chan") = 0,
+ D(sink,set_center_freq)
+ )
+
+
+ .def("get_center_freq",&sink::get_center_freq,
+ py::arg("chan") = 0,
+ D(sink,get_center_freq)
+ )
+
+
+ .def("set_freq_corr",&sink::set_freq_corr,
+ py::arg("ppm"),
+ py::arg("chan") = 0,
+ D(sink,set_freq_corr)
+ )
+
+
+ .def("get_freq_corr",&sink::get_freq_corr,
+ py::arg("chan") = 0,
+ D(sink,get_freq_corr)
+ )
+
+
+ .def("get_gain_names",&sink::get_gain_names,
+ py::arg("chan") = 0,
+ D(sink,get_gain_names)
+ )
+
+
+ .def("get_gain_range",(osmosdr::gain_range_t (sink::*)(size_t))&sink::get_gain_range,
+ py::arg("chan") = 0,
+ D(sink,get_gain_range,0)
+ )
+
+
+ .def("get_gain_range",(osmosdr::gain_range_t (sink::*)(std::string const &, size_t))&sink::get_gain_range,
+ py::arg("name"),
+ py::arg("chan") = 0,
+ D(sink,get_gain_range,1)
+ )
+
+
+ .def("set_gain_mode",&sink::set_gain_mode,
+ py::arg("automatic"),
+ py::arg("chan") = 0,
+ D(sink,set_gain_mode)
+ )
+
+
+ .def("get_gain_mode",&sink::get_gain_mode,
+ py::arg("chan") = 0,
+ D(sink,get_gain_mode)
+ )
+
+
+ .def("set_gain",(double (sink::*)(double, size_t))&sink::set_gain,
+ py::arg("gain"),
+ py::arg("chan") = 0,
+ D(sink,set_gain,0)
+ )
+
+
+ .def("set_gain",(double (sink::*)(double, std::string const &, size_t))&sink::set_gain,
+ py::arg("gain"),
+ py::arg("name"),
+ py::arg("chan") = 0,
+ D(sink,set_gain,1)
+ )
+
+
+ .def("get_gain",(double (sink::*)(size_t))&sink::get_gain,
+ py::arg("chan") = 0,
+ D(sink,get_gain,0)
+ )
+
+
+ .def("get_gain",(double (sink::*)(std::string const &, size_t))&sink::get_gain,
+ py::arg("name"),
+ py::arg("chan") = 0,
+ D(sink,get_gain,1)
+ )
+
+
+ .def("set_if_gain",&sink::set_if_gain,
+ py::arg("gain"),
+ py::arg("chan") = 0,
+ D(sink,set_if_gain)
+ )
+
+
+ .def("set_bb_gain",&sink::set_bb_gain,
+ py::arg("gain"),
+ py::arg("chan") = 0,
+ D(sink,set_bb_gain)
+ )
+
+
+ .def("get_antennas",&sink::get_antennas,
+ py::arg("chan") = 0,
+ D(sink,get_antennas)
+ )
+
+
+ .def("set_antenna",&sink::set_antenna,
+ py::arg("antenna"),
+ py::arg("chan") = 0,
+ D(sink,set_antenna)
+ )
+
+
+ .def("get_antenna",&sink::get_antenna,
+ py::arg("chan") = 0,
+ D(sink,get_antenna)
+ )
+
+
+ .def("set_dc_offset",&sink::set_dc_offset,
+ py::arg("offset"),
+ py::arg("chan") = 0,
+ D(sink,set_dc_offset)
+ )
+
+
+ .def("set_iq_balance",&sink::set_iq_balance,
+ py::arg("balance"),
+ py::arg("chan") = 0,
+ D(sink,set_iq_balance)
+ )
+
+
+ .def("set_bandwidth",&sink::set_bandwidth,
+ py::arg("bandwidth"),
+ py::arg("chan") = 0,
+ D(sink,set_bandwidth)
+ )
+
+
+ .def("get_bandwidth",&sink::get_bandwidth,
+ py::arg("chan") = 0,
+ D(sink,get_bandwidth)
+ )
+
+
+ .def("get_bandwidth_range",&sink::get_bandwidth_range,
+ py::arg("chan") = 0,
+ D(sink,get_bandwidth_range)
+ )
+
+
+ .def("set_time_source",&sink::set_time_source,
+ py::arg("source"),
+ py::arg("mboard") = 0,
+ D(sink,set_time_source)
+ )
+
+
+ .def("get_time_source",&sink::get_time_source,
+ py::arg("mboard"),
+ D(sink,get_time_source)
+ )
+
+
+ .def("get_time_sources",&sink::get_time_sources,
+ py::arg("mboard"),
+ D(sink,get_time_sources)
+ )
+
+
+ .def("set_clock_source",&sink::set_clock_source,
+ py::arg("source"),
+ py::arg("mboard") = 0,
+ D(sink,set_clock_source)
+ )
+
+
+ .def("get_clock_source",&sink::get_clock_source,
+ py::arg("mboard"),
+ D(sink,get_clock_source)
+ )
+
+
+ .def("get_clock_sources",&sink::get_clock_sources,
+ py::arg("mboard"),
+ D(sink,get_clock_sources)
+ )
+
+
+ .def("get_clock_rate",&sink::get_clock_rate,
+ py::arg("mboard") = 0,
+ D(sink,get_clock_rate)
+ )
+
+
+ .def("set_clock_rate",&sink::set_clock_rate,
+ py::arg("rate"),
+ py::arg("mboard") = 0,
+ D(sink,set_clock_rate)
+ )
+
+
+ .def("get_time_now",&sink::get_time_now,
+ py::arg("mboard") = 0,
+ D(sink,get_time_now)
+ )
+
+
+ .def("get_time_last_pps",&sink::get_time_last_pps,
+ py::arg("mboard") = 0,
+ D(sink,get_time_last_pps)
+ )
+
+
+ .def("set_time_now",&sink::set_time_now,
+ py::arg("time_spec"),
+ py::arg("mboard") = 0,
+ D(sink,set_time_now)
+ )
+
+
+ .def("set_time_next_pps",&sink::set_time_next_pps,
+ py::arg("time_spec"),
+ D(sink,set_time_next_pps)
+ )
+
+
+ .def("set_time_unknown_pps",&sink::set_time_unknown_pps,
+ py::arg("time_spec"),
+ D(sink,set_time_unknown_pps)
+ )
+
+ ;
+
+
+
+
+}
+
+
+
+
+
+
+
diff --git a/python/bindings/source_python.cc b/python/bindings/source_python.cc
new file mode 100644
index 0000000..0cab394
--- /dev/null
+++ b/python/bindings/source_python.cc
@@ -0,0 +1,342 @@
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+/***********************************************************************************/
+/* This file is automatically generated using bindtool and can be manually edited */
+/* The following lines can be configured to regenerate this file during cmake */
+/* If manual edits are made, the following tags should be modified accordingly. */
+/* BINDTOOL_GEN_AUTOMATIC(1) */
+/* BINDTOOL_USE_PYGCCXML(0) */
+/* BINDTOOL_HEADER_FILE(source.h) */
+/* BINDTOOL_HEADER_FILE_HASH(d1a3d9ea3d815fe4f18acc3eef21f1b6) */
+/***********************************************************************************/
+
+#include <pybind11/complex.h>
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+
+namespace py = pybind11;
+
+#include <osmosdr/source.h>
+// pydoc.h is automatically generated in the build directory
+#include <source_pydoc.h>
+
+void bind_source(py::module& m)
+{
+
+ using source = ::osmosdr::source;
+
+
+ py::class_<source, gr::hier_block2,
+ std::shared_ptr<source>>(m, "source", D(source))
+
+ .def(py::init(&source::make),
+ py::arg("args") = "",
+ D(source,make)
+ )
+
+
+
+
+
+ .def("get_num_channels",&source::get_num_channels,
+ D(source,get_num_channels)
+ )
+
+
+ .def("seek",&source::seek,
+ py::arg("seek_point"),
+ py::arg("whence"),
+ py::arg("chan") = 0,
+ D(source,seek)
+ )
+
+
+ .def("get_sample_rates",&source::get_sample_rates,
+ D(source,get_sample_rates)
+ )
+
+
+ .def("set_sample_rate",&source::set_sample_rate,
+ py::arg("rate"),
+ D(source,set_sample_rate)
+ )
+
+
+ .def("get_sample_rate",&source::get_sample_rate,
+ D(source,get_sample_rate)
+ )
+
+
+ .def("get_freq_range",&source::get_freq_range,
+ py::arg("chan") = 0,
+ D(source,get_freq_range)
+ )
+
+
+ .def("set_center_freq",&source::set_center_freq,
+ py::arg("freq"),
+ py::arg("chan") = 0,
+ D(source,set_center_freq)
+ )
+
+
+ .def("get_center_freq",&source::get_center_freq,
+ py::arg("chan") = 0,
+ D(source,get_center_freq)
+ )
+
+
+ .def("set_freq_corr",&source::set_freq_corr,
+ py::arg("ppm"),
+ py::arg("chan") = 0,
+ D(source,set_freq_corr)
+ )
+
+
+ .def("get_freq_corr",&source::get_freq_corr,
+ py::arg("chan") = 0,
+ D(source,get_freq_corr)
+ )
+
+
+ .def("get_gain_names",&source::get_gain_names,
+ py::arg("chan") = 0,
+ D(source,get_gain_names)
+ )
+
+
+ .def("get_gain_range",(osmosdr::gain_range_t (source::*)(size_t))&source::get_gain_range,
+ py::arg("chan") = 0,
+ D(source,get_gain_range,0)
+ )
+
+
+ .def("get_gain_range",(osmosdr::gain_range_t (source::*)(std::string const &, size_t))&source::get_gain_range,
+ py::arg("name"),
+ py::arg("chan") = 0,
+ D(source,get_gain_range,1)
+ )
+
+
+ .def("set_gain_mode",&source::set_gain_mode,
+ py::arg("automatic"),
+ py::arg("chan") = 0,
+ D(source,set_gain_mode)
+ )
+
+
+ .def("get_gain_mode",&source::get_gain_mode,
+ py::arg("chan") = 0,
+ D(source,get_gain_mode)
+ )
+
+
+ .def("set_gain",(double (source::*)(double, size_t))&source::set_gain,
+ py::arg("gain"),
+ py::arg("chan") = 0,
+ D(source,set_gain,0)
+ )
+
+
+ .def("set_gain",(double (source::*)(double, std::string const &, size_t))&source::set_gain,
+ py::arg("gain"),
+ py::arg("name"),
+ py::arg("chan") = 0,
+ D(source,set_gain,1)
+ )
+
+
+ .def("get_gain",(double (source::*)(size_t))&source::get_gain,
+ py::arg("chan") = 0,
+ D(source,get_gain,0)
+ )
+
+
+ .def("get_gain",(double (source::*)(std::string const &, size_t))&source::get_gain,
+ py::arg("name"),
+ py::arg("chan") = 0,
+ D(source,get_gain,1)
+ )
+
+
+ .def("set_if_gain",&source::set_if_gain,
+ py::arg("gain"),
+ py::arg("chan") = 0,
+ D(source,set_if_gain)
+ )
+
+
+ .def("set_bb_gain",&source::set_bb_gain,
+ py::arg("gain"),
+ py::arg("chan") = 0,
+ D(source,set_bb_gain)
+ )
+
+
+ .def("get_antennas",&source::get_antennas,
+ py::arg("chan") = 0,
+ D(source,get_antennas)
+ )
+
+
+ .def("set_antenna",&source::set_antenna,
+ py::arg("antenna"),
+ py::arg("chan") = 0,
+ D(source,set_antenna)
+ )
+
+
+ .def("get_antenna",&source::get_antenna,
+ py::arg("chan") = 0,
+ D(source,get_antenna)
+ )
+
+
+ .def("set_dc_offset_mode",&source::set_dc_offset_mode,
+ py::arg("mode"),
+ py::arg("chan") = 0,
+ D(source,set_dc_offset_mode)
+ )
+
+
+ .def("set_dc_offset",&source::set_dc_offset,
+ py::arg("offset"),
+ py::arg("chan") = 0,
+ D(source,set_dc_offset)
+ )
+
+
+ .def("set_iq_balance_mode",&source::set_iq_balance_mode,
+ py::arg("mode"),
+ py::arg("chan") = 0,
+ D(source,set_iq_balance_mode)
+ )
+
+
+ .def("set_iq_balance",&source::set_iq_balance,
+ py::arg("balance"),
+ py::arg("chan") = 0,
+ D(source,set_iq_balance)
+ )
+
+
+ .def("set_bandwidth",&source::set_bandwidth,
+ py::arg("bandwidth"),
+ py::arg("chan") = 0,
+ D(source,set_bandwidth)
+ )
+
+
+ .def("get_bandwidth",&source::get_bandwidth,
+ py::arg("chan") = 0,
+ D(source,get_bandwidth)
+ )
+
+
+ .def("get_bandwidth_range",&source::get_bandwidth_range,
+ py::arg("chan") = 0,
+ D(source,get_bandwidth_range)
+ )
+
+
+ .def("set_time_source",&source::set_time_source,
+ py::arg("source"),
+ py::arg("mboard") = 0,
+ D(source,set_time_source)
+ )
+
+
+ .def("get_time_source",&source::get_time_source,
+ py::arg("mboard"),
+ D(source,get_time_source)
+ )
+
+
+ .def("get_time_sources",&source::get_time_sources,
+ py::arg("mboard"),
+ D(source,get_time_sources)
+ )
+
+
+ .def("set_clock_source",&source::set_clock_source,
+ py::arg("source"),
+ py::arg("mboard") = 0,
+ D(source,set_clock_source)
+ )
+
+
+ .def("get_clock_source",&source::get_clock_source,
+ py::arg("mboard"),
+ D(source,get_clock_source)
+ )
+
+
+ .def("get_clock_sources",&source::get_clock_sources,
+ py::arg("mboard"),
+ D(source,get_clock_sources)
+ )
+
+
+ .def("get_clock_rate",&source::get_clock_rate,
+ py::arg("mboard") = 0,
+ D(source,get_clock_rate)
+ )
+
+
+ .def("set_clock_rate",&source::set_clock_rate,
+ py::arg("rate"),
+ py::arg("mboard") = 0,
+ D(source,set_clock_rate)
+ )
+
+
+ .def("get_time_now",&source::get_time_now,
+ py::arg("mboard") = 0,
+ D(source,get_time_now)
+ )
+
+
+ .def("get_time_last_pps",&source::get_time_last_pps,
+ py::arg("mboard") = 0,
+ D(source,get_time_last_pps)
+ )
+
+
+ .def("set_time_now",&source::set_time_now,
+ py::arg("time_spec"),
+ py::arg("mboard") = 0,
+ D(source,set_time_now)
+ )
+
+
+ .def("set_time_next_pps",&source::set_time_next_pps,
+ py::arg("time_spec"),
+ D(source,set_time_next_pps)
+ )
+
+
+ .def("set_time_unknown_pps",&source::set_time_unknown_pps,
+ py::arg("time_spec"),
+ D(source,set_time_unknown_pps)
+ )
+
+ ;
+
+
+
+
+}
+
+
+
+
+
+
+
diff --git a/python/bindings/time_spec_python.cc b/python/bindings/time_spec_python.cc
new file mode 100644
index 0000000..d12a3c7
--- /dev/null
+++ b/python/bindings/time_spec_python.cc
@@ -0,0 +1,33 @@
+#include <pybind11/pybind11.h>
+#include <pybind11/operators.h>
+
+namespace py = pybind11;
+
+#include <osmosdr/time_spec.h>
+
+void bind_time_spec(py::module& m)
+{
+ using time_spec_t = ::osmosdr::time_spec_t;
+
+ py::class_<time_spec_t>(m, "time_spec_t")
+ .def_static("get_system_time", &time_spec_t::get_system_time)
+ .def(py::init<double>(), py::arg("secs") = 0)
+ .def(py::init<time_t, double>(), py::arg("full_secs"), py::arg("frac_secs") = 0)
+ .def(py::init<time_t, long, double>(), py::arg("full_secs"), py::arg("tick_count"), py::arg("tick_rate"))
+ .def_static("from_ticks", &time_spec_t::from_ticks, py::arg("ticks"), py::arg("tick_rate"))
+ .def("get_tick_count", &time_spec_t::get_tick_count, py::arg("tick_rate"))
+ .def("to_ticks", &time_spec_t::to_ticks, py::arg("tick_rate"))
+ .def("get_real_secs", &time_spec_t::get_real_secs)
+ .def("get_full_secs", &time_spec_t::get_full_secs)
+ .def("get_frac_secs", &time_spec_t::get_frac_secs)
+ .def(py::self + py::self)
+ .def(py::self += py::self)
+ .def(py::self - py::self)
+ .def(py::self -= py::self)
+ .def(py::self == py::self)
+ .def(py::self != py::self)
+ .def(py::self < py::self)
+ .def(py::self > py::self)
+ .def(py::self <= py::self)
+ .def(py::self >= py::self);
+}
diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
deleted file mode 100644
index 3949322..0000000
--- a/swig/CMakeLists.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-
-########################################################################
-# Include swig generation macros
-########################################################################
-find_package(SWIG)
-find_package(PythonLibs 2)
-if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
- return()
-endif()
-include(GrSwig)
-include(GrPython)
-
-########################################################################
-# Setup swig generation
-########################################################################
-foreach(incdir ${GNURADIO_ALL_INCLUDE_DIRS})
- list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
-endforeach(incdir)
-
-set(GR_SWIG_LIBRARIES gnuradio-osmosdr)
-set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/osmosdr_swig_doc.i)
-set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include)
-
-GR_SWIG_MAKE(osmosdr_swig osmosdr_swig.i)
-
-########################################################################
-# Install the build swig module
-########################################################################
-GR_SWIG_INSTALL(TARGETS osmosdr_swig DESTINATION ${GR_PYTHON_DIR}/osmosdr)
-
-########################################################################
-# Install swig .i files for development
-########################################################################
-install(
- FILES
- osmosdr_swig.i
- ${CMAKE_CURRENT_BINARY_DIR}/osmosdr_swig_doc.i
- DESTINATION ${GR_INCLUDE_DIR}/osmosdr/swig
-)
diff --git a/swig/osmosdr_swig.i b/swig/osmosdr_swig.i
deleted file mode 100644
index 550008b..0000000
--- a/swig/osmosdr_swig.i
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- c++ -*- */
-
-#define OSMOSDR_API
-
-// suppress Warning 319: No access specifier given for base class 'boost::noncopyable' (ignored).
-#pragma SWIG nowarn=319
-
-%include "gnuradio.i" // the common stuff
-
-//load generated python docstrings
-%include "osmosdr_swig_doc.i"
-
-%{
-#include "osmosdr/device.h"
-#include "osmosdr/source.h"
-#include "osmosdr/sink.h"
-%}
-
-// Workaround for a SWIG 2.0.4 bug with templates. Probably needs to be looked in to.
-%{
-#if PY_VERSION_HEX >= 0x03020000
-# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
-#else
-# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
-#endif
-%}
-
-%template(string_vector_t) std::vector<std::string>;
-
-//%template(size_vector_t) std::vector<size_t>;
-
-%include <osmosdr/pimpl.h>
-
-%ignore osmosdr::device_t::operator[]; //ignore warnings about %extend
-
-%template(string_string_dict_t) std::map<std::string, std::string>; //define before device
-%template(devices_t) std::vector<osmosdr::device_t>;
-%include <osmosdr/device.h>
-
-//%extend std::map<std::string, std::string>{
-// std::string __getitem__(std::string key) {return (*self)[key];}
-// void __setitem__(std::string key, std::string val) {(*self)[key] = val;}
-//};
-
-%template(range_vector_t) std::vector<osmosdr::range_t>; //define before range
-%include <osmosdr/ranges.h>
-
-%include <osmosdr/time_spec.h>
-
-%extend osmosdr::time_spec_t{
- osmosdr::time_spec_t __add__(const osmosdr::time_spec_t &what)
- {
- osmosdr::time_spec_t temp = *self;
- temp += what;
- return temp;
- }
- osmosdr::time_spec_t __sub__(const osmosdr::time_spec_t &what)
- {
- osmosdr::time_spec_t temp = *self;
- temp -= what;
- return temp;
- }
-};
-
-%define OSMOSDR_SWIG_BLOCK_MAGIC2(PKG, BASE_NAME)
-%template(BASE_NAME ## _sptr) boost::shared_ptr<PKG ## :: ## BASE_NAME>;
-%pythoncode %{
-BASE_NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(), self.unique_id())
-BASE_NAME = BASE_NAME.make;
-%}
-%enddef
-
-%include "osmosdr/source.h"
-%include "osmosdr/sink.h"
-
-OSMOSDR_SWIG_BLOCK_MAGIC2(osmosdr,source);
-OSMOSDR_SWIG_BLOCK_MAGIC2(osmosdr,sink);
-
-%{
-static const size_t ALL_MBOARDS = osmosdr::ALL_MBOARDS;
-%}
-//static const size_t ALL_MBOARDS;