diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b86d665 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +.*.swp diff --git a/CMakeLists.txt b/CMakeLists.txt index fb01281..cdfa998 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,19 +83,8 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Find gnuradio build dependencies ######################################################################## -find_package(Gruel) -find_package(GnuradioCore) -#find_package(GnuradioAudio) -#find_package(LibUSB) - -if(NOT GRUEL_FOUND) - message(FATAL_ERROR "Gruel required to compile afsk") -endif() - -if(NOT GNURADIO_CORE_FOUND) - message(FATAL_ERROR "GnuRadio Core required to compile afsk") -endif() - +set(GR_REQUIRED_COMPONENTS RUNTIME) +find_package(Gnuradio "3.7.2" REQUIRED) ######################################################################## # Setup the include and linker paths @@ -105,17 +94,13 @@ include_directories( ${CMAKE_SOURCE_DIR}/lib/multimon/ ${CMAKE_SOURCE_DIR}/lib ${Boost_INCLUDE_DIRS} - ${GRUEL_INCLUDE_DIRS} - ${GNURADIO_CORE_INCLUDE_DIRS} -# ${LIBUSB_INCLUDE_DIR} + ${GNURADIO_ALL_INCLUDE_DIRS} ${LIBRTLSDR_INCLUDE_DIR} ) link_directories( ${Boost_LIBRARY_DIRS} - ${GRUEL_LIBRARY_DIRS} - ${GNURADIO_CORE_LIBRARY_DIRS} -# ${LIBUSB_LIBRARY_DIRS} + ${GNURADIO_RUNTIME_LIBRARY_DIRS} ${LIBRTLSDR_LIBRARIES} ) @@ -144,5 +129,5 @@ add_subdirectory(lib) add_subdirectory(swig) add_subdirectory(python) add_subdirectory(grc) -#add_subdirectory(apps) +add_subdirectory(examples) #add_subdirectory(docs) diff --git a/cmake/Modules/FindGnuradioAudio.cmake b/cmake/Modules/FindGnuradioAudio.cmake deleted file mode 100644 index 63207f5..0000000 --- a/cmake/Modules/FindGnuradioAudio.cmake +++ /dev/null @@ -1,26 +0,0 @@ -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_GNURADIO_AUDIO gnuradio-audio) - -FIND_PATH( - GNURADIO_AUDIO_INCLUDE_DIRS - NAMES gr_audio_api.h - HINTS $ENV{GNURADIO_AUDIO_DIR}/include/gnuradio - ${PC_GNURADIO_AUDIO_INCLUDEDIR} - PATHS /usr/local/include/gnuradio - /usr/include/gnuradio -) - -FIND_LIBRARY( - GNURADIO_AUDIO_LIBRARIES - NAMES gnuradio-audio - HINTS $ENV{GNURADIO_AUDIO_DIR}/lib - ${PC_GNURADIO_AUDIO_LIBDIR} - PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 -) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_AUDIO DEFAULT_MSG GNURADIO_AUDIO_LIBRARIES GNURADIO_AUDIO_INCLUDE_DIRS) -MARK_AS_ADVANCED(GNURADIO_AUDIO_LIBRARIES GNURADIO_AUDIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGnuradioCore.cmake b/cmake/Modules/FindGnuradioCore.cmake deleted file mode 100644 index 3773588..0000000 --- a/cmake/Modules/FindGnuradioCore.cmake +++ /dev/null @@ -1,26 +0,0 @@ -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_GNURADIO_CORE gnuradio-core) - -FIND_PATH( - GNURADIO_CORE_INCLUDE_DIRS - NAMES gr_random.h - HINTS $ENV{GNURADIO_CORE_DIR}/include/gnuradio - ${PC_GNURADIO_CORE_INCLUDEDIR} - PATHS /usr/local/include/gnuradio - /usr/include/gnuradio -) - -FIND_LIBRARY( - GNURADIO_CORE_LIBRARIES - NAMES gnuradio-core - HINTS $ENV{GNURADIO_CORE_DIR}/lib - ${PC_GNURADIO_CORE_LIBDIR} - PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 -) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_CORE DEFAULT_MSG GNURADIO_CORE_LIBRARIES GNURADIO_CORE_INCLUDE_DIRS) -MARK_AS_ADVANCED(GNURADIO_CORE_LIBRARIES GNURADIO_CORE_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGnuradioRuntime.cmake b/cmake/Modules/FindGnuradioRuntime.cmake new file mode 100644 index 0000000..afed684 --- /dev/null +++ b/cmake/Modules/FindGnuradioRuntime.cmake @@ -0,0 +1,36 @@ +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) + +if(PC_GNURADIO_RUNTIME_FOUND) + # look for include files + FIND_PATH( + GNURADIO_RUNTIME_INCLUDE_DIRS + NAMES gnuradio/top_block.h + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${PC_GNURADIO_RUNTIME_INCLUDE_DIRS} + ${CMAKE_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include + ) + + # look for libs + FIND_LIBRARY( + GNURADIO_RUNTIME_LIBRARIES + NAMES gnuradio-runtime + HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib + ${PC_GNURADIO_RUNTIME_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib/ + ${CMAKE_INSTALL_PREFIX}/lib64/ + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 + ) + + set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND}) +endif(PC_GNURADIO_RUNTIME_FOUND) + +INCLUDE(FindPackageHandleStandardArgs) +# do not check GNURADIO_RUNTIME_INCLUDE_DIRS, is not set when default include path us used. +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES) +MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGruel.cmake b/cmake/Modules/FindGruel.cmake deleted file mode 100644 index 58dff70..0000000 --- a/cmake/Modules/FindGruel.cmake +++ /dev/null @@ -1,26 +0,0 @@ -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_GRUEL gruel) - -FIND_PATH( - GRUEL_INCLUDE_DIRS - NAMES gruel/attributes.h - HINTS $ENV{GRUEL_DIR}/include - ${PC_GRUEL_INCLUDEDIR} - PATHS /usr/local/include - /usr/include -) - -FIND_LIBRARY( - GRUEL_LIBRARIES - NAMES gruel - HINTS $ENV{GRUEL_DIR}/lib - ${PC_GRUEL_LIBDIR} - PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 -) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GRUEL DEFAULT_MSG GRUEL_LIBRARIES GRUEL_INCLUDE_DIRS) -MARK_AS_ADVANCED(GRUEL_LIBRARIES GRUEL_INCLUDE_DIRS) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..c5219bb --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,23 @@ +# 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. + +install(FILES + aprs_decode_file.grc + DESTINATION share/gnuradio/examples/multimon +) diff --git a/examples/aprs_decode_file.grc b/examples/aprs_decode_file.grc index 03607e7..1af440b 100644 --- a/examples/aprs_decode_file.grc +++ b/examples/aprs_decode_file.grc @@ -167,7 +167,7 @@ - gr_null_sink + blocks_null_sink id gr_null_sink_1 @@ -194,7 +194,7 @@ - gr_file_source + blocks_file_source id gr_file_source_0 @@ -308,7 +308,7 @@ - gr_throttle + blocks_throttle id gr_throttle_0 @@ -339,7 +339,7 @@ - gr_add_const_vxx + blocks_add_const_vxx id gr_add_const_vxx_0 @@ -370,7 +370,7 @@ - gr_float_to_int + blocks_float_to_int id gr_float_to_int_0 @@ -397,7 +397,7 @@ - gr_uchar_to_float + blocks_uchar_to_float id gr_uchar_to_float_0 @@ -416,7 +416,7 @@ - blks2_nbfm_rx + analog_nbfm_rx id blks2_nbfm_rx_0 @@ -470,7 +470,7 @@ - blks2_rational_resampler_xxx + rational_resampler_xxx id blks2_rational_resampler_xxx_0 @@ -559,7 +559,7 @@ - gr_message_sink + blocks_message_sink id gr_message_sink_0 diff --git a/include/multimon/afsk1200.h b/include/multimon/afsk1200.h index 03e0370..cee1892 100644 --- a/include/multimon/afsk1200.h +++ b/include/multimon/afsk1200.h @@ -22,9 +22,7 @@ #ifndef INCLUDED_AFSK1200_H #define INCLUDED_AFSK1200_H -//#include - -#include +#include extern "C"{ #include } @@ -33,7 +31,7 @@ extern "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 + * to gr::block's (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. @@ -60,7 +58,7 @@ __GR_ATTR_EXPORT multimon_afsk1200_sptr make_multimon_afsk1200 ();// (const std: * * \sa howto_square2_ff for a version that subclasses gr_sync_block. */ - class multimon_afsk1200 : public gr_block + class multimon_afsk1200 : public gr::block { private: // The friend declaration allows howto_make_square_ff to diff --git a/include/multimon/hdlc.h b/include/multimon/hdlc.h index 10dfeec..0a36944 100644 --- a/include/multimon/hdlc.h +++ b/include/multimon/hdlc.h @@ -24,7 +24,7 @@ //#include -#include +#include extern "C"{ #include } @@ -33,7 +33,7 @@ extern "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 + * to gr::block's (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. @@ -60,7 +60,7 @@ __GR_ATTR_EXPORT multimon_hdlc_sptr make_multimon_hdlc ();// (const std::string * * \sa howto_square2_ff for a version that subclasses gr_sync_block. */ - class multimon_hdlc : public gr_block + class multimon_hdlc : public gr::block { private: // The friend declaration allows howto_make_square_ff to diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index d2d80b4..df88e45 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -35,8 +35,7 @@ add_library(gnuradio-multimon SHARED target_link_libraries(gnuradio-multimon ${Boost_LIBRARIES} - ${GRUEL_LIBRARIES} - ${GNURADIO_CORE_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} ) set_target_properties(gnuradio-multimon PROPERTIES DEFINE_SYMBOL "gnuradio_multimon_EXPORTS") diff --git a/lib/afsk1200.cc b/lib/afsk1200.cc index cfb06b0..4c2d7e7 100644 --- a/lib/afsk1200.cc +++ b/lib/afsk1200.cc @@ -34,7 +34,7 @@ #include #include #include -#include +#include /* * Create a new instance of multimon_afsk1200 and return @@ -50,7 +50,7 @@ make_multimon_afsk1200()//(const std::string &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 + * (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 @@ -85,9 +85,9 @@ static float corr_space_q[CORRLEN]; * The private constructor */ multimon_afsk1200::multimon_afsk1200 () - : gr_block ("multimon_afsk1200_demod", - gr_make_io_signature (MIN_IN, MAX_IN, sizeof (float)), - gr_make_io_signature (MIN_OUT, MAX_OUT, sizeof (char))) + : gr::block ("multimon_afsk1200_demod", + gr::io_signature::make (MIN_IN, MAX_IN, sizeof (float)), + gr::io_signature::make (MIN_OUT, MAX_OUT, sizeof (char))) { state = (demod_state*) malloc(sizeof(demod_state)); memset(state, 0, sizeof(*state)); diff --git a/lib/hdlc.cc b/lib/hdlc.cc index 6ef1607..746fd13 100644 --- a/lib/hdlc.cc +++ b/lib/hdlc.cc @@ -24,7 +24,7 @@ #include "hdlc.h" #include #include -#include +#include /* ---------------------------------------------------------------------- */ @@ -247,9 +247,9 @@ make_multimon_hdlc()//(const std::string &args) } multimon_hdlc::multimon_hdlc()//struct demod_state *s) - : gr_block ("multimon_hldc", - gr_make_io_signature (1, 1, sizeof (char)), - gr_make_io_signature (1, 1, sizeof (char))) + : gr::block ("multimon_hldc", + gr::io_signature::make (1, 1, sizeof (char)), + gr::io_signature::make (1, 1, sizeof (char))) { s = (demod_state*) malloc(sizeof(demod_state)); memset(s, 0, sizeof(*s)); diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index dce58ea..94981ba 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -21,7 +21,7 @@ # Include swig generation macros ######################################################################## find_package(SWIG) -find_package(PythonLibs) +find_package(PythonLibs 2) if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) return() endif() @@ -31,17 +31,11 @@ include(GrPython) ######################################################################## # Setup swig generation ######################################################################## -foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS}) - list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig) -endforeach(incdir) - -foreach(incdir ${GRUEL_INCLUDE_DIRS}) - list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gruel/swig) +foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS}) + list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig) endforeach(incdir) set(GR_SWIG_LIBRARIES gnuradio-multimon) -#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(multimon_swig multimon_swig.i) @@ -56,6 +50,5 @@ GR_SWIG_INSTALL(TARGETS multimon_swig DESTINATION ${GR_PYTHON_DIR}/multimon) install( FILES multimon_swig.i -# ${CMAKE_CURRENT_BINARY_DIR}/osmosdr_swig_doc.i DESTINATION ${GR_INCLUDE_DIR}/multimon ) diff --git a/swig/multimon_swig.i b/swig/multimon_swig.i index fb7a5d0..7717642 100644 --- a/swig/multimon_swig.i +++ b/swig/multimon_swig.i @@ -2,7 +2,7 @@ %include "std_common.i" // the common stuff %include "exception.i" -%import "gnuradio.i" // the common stuff +%include "gnuradio.i" // the common stuff %{ #include "gnuradio_swig_bug_workaround.h" // mandatory bug fix #include "afsk1200.h" @@ -23,7 +23,7 @@ GR_SWIG_BLOCK_MAGIC(multimon, afsk1200); multimon_afsk1200_sptr make_multimon_afsk1200 (); -class multimon_afsk1200 : public gr_block +class multimon_afsk1200 : public gr::block { private: multimon_afsk1200 (); @@ -33,7 +33,7 @@ GR_SWIG_BLOCK_MAGIC(multimon, hdlc); multimon_hdlc_sptr make_multimon_hdlc (); -class multimon_hdlc : public gr_block +class multimon_hdlc : public gr::block { private: multimon_hdlc ();