Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to GnuRadio 3.7 API #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
.*.swp
25 changes: 5 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
)

Expand Down Expand Up @@ -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)
26 changes: 0 additions & 26 deletions cmake/Modules/FindGnuradioAudio.cmake

This file was deleted.

26 changes: 0 additions & 26 deletions cmake/Modules/FindGnuradioCore.cmake

This file was deleted.

36 changes: 36 additions & 0 deletions cmake/Modules/FindGnuradioRuntime.cmake
Original file line number Diff line number Diff line change
@@ -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)
26 changes: 0 additions & 26 deletions cmake/Modules/FindGruel.cmake

This file was deleted.

23 changes: 23 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)
18 changes: 9 additions & 9 deletions examples/aprs_decode_file.grc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
</param>
</block>
<block>
<key>gr_null_sink</key>
<key>blocks_null_sink</key>
<param>
<key>id</key>
<value>gr_null_sink_1</value>
Expand All @@ -194,7 +194,7 @@
</param>
</block>
<block>
<key>gr_file_source</key>
<key>blocks_file_source</key>
<param>
<key>id</key>
<value>gr_file_source_0</value>
Expand Down Expand Up @@ -308,7 +308,7 @@
</param>
</block>
<block>
<key>gr_throttle</key>
<key>blocks_throttle</key>
<param>
<key>id</key>
<value>gr_throttle_0</value>
Expand Down Expand Up @@ -339,7 +339,7 @@
</param>
</block>
<block>
<key>gr_add_const_vxx</key>
<key>blocks_add_const_vxx</key>
<param>
<key>id</key>
<value>gr_add_const_vxx_0</value>
Expand Down Expand Up @@ -370,7 +370,7 @@
</param>
</block>
<block>
<key>gr_float_to_int</key>
<key>blocks_float_to_int</key>
<param>
<key>id</key>
<value>gr_float_to_int_0</value>
Expand All @@ -397,7 +397,7 @@
</param>
</block>
<block>
<key>gr_uchar_to_float</key>
<key>blocks_uchar_to_float</key>
<param>
<key>id</key>
<value>gr_uchar_to_float_0</value>
Expand All @@ -416,7 +416,7 @@
</param>
</block>
<block>
<key>blks2_nbfm_rx</key>
<key>analog_nbfm_rx</key>
<param>
<key>id</key>
<value>blks2_nbfm_rx_0</value>
Expand Down Expand Up @@ -470,7 +470,7 @@
</param>
</block>
<block>
<key>blks2_rational_resampler_xxx</key>
<key>rational_resampler_xxx</key>
<param>
<key>id</key>
<value>blks2_rational_resampler_xxx_0</value>
Expand Down Expand Up @@ -559,7 +559,7 @@
</param>
</block>
<block>
<key>gr_message_sink</key>
<key>blocks_message_sink</key>
<param>
<key>id</key>
<value>gr_message_sink_0</value>
Expand Down
8 changes: 3 additions & 5 deletions include/multimon/afsk1200.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
#ifndef INCLUDED_AFSK1200_H
#define INCLUDED_AFSK1200_H

//#include <gr_hier_block2.h>

#include <gr_block.h>
#include <gnuradio/block.h>
extern "C"{
#include <multimon.h>
}
Expand All @@ -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.
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions include/multimon/hdlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

//#include <gr_hier_block2.h>

#include <gr_block.h>
#include <gnuradio/block.h>
extern "C"{
#include <multimon.h>
}
Expand All @@ -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.
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions lib/afsk1200.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <afsk1200.h>
#include <gr_io_signature.h>
#include <gnuradio/io_signature.h>

/*
* Create a new instance of multimon_afsk1200 and return
Expand All @@ -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
Expand Down Expand Up @@ -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));
Expand Down
8 changes: 4 additions & 4 deletions lib/hdlc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "hdlc.h"
#include <string.h>
#include <stdio.h>
#include <gr_io_signature.h>
#include <gnuradio/io_signature.h>

/* ---------------------------------------------------------------------- */

Expand Down Expand Up @@ -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));
Expand Down
Loading