diff options
Diffstat (limited to 'gnuradio-core/src/lib/io')
36 files changed, 227 insertions, 73 deletions
diff --git a/gnuradio-core/src/lib/io/CMakeLists.txt b/gnuradio-core/src/lib/io/CMakeLists.txt new file mode 100644 index 000000000..7ffe8306e --- /dev/null +++ b/gnuradio-core/src/lib/io/CMakeLists.txt @@ -0,0 +1,108 @@ +# 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. + +######################################################################## +# This file included, use CMake directory variables +######################################################################## + +######################################################################## +# Append gnuradio-core library sources +######################################################################## +LIST(APPEND gnuradio_core_sources + ${CMAKE_CURRENT_SOURCE_DIR}/gr_histo_sink_f.cc + ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_guts.cc + ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink_f.cc + ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink_x.cc + ${CMAKE_CURRENT_SOURCE_DIR}/i2c.cc + ${CMAKE_CURRENT_SOURCE_DIR}/i2c_bitbang.cc + ${CMAKE_CURRENT_SOURCE_DIR}/i2c_bbio.cc + ${CMAKE_CURRENT_SOURCE_DIR}/i2c_bbio_pp.cc + ${CMAKE_CURRENT_SOURCE_DIR}/microtune_4702.cc + ${CMAKE_CURRENT_SOURCE_DIR}/microtune_4937.cc + ${CMAKE_CURRENT_SOURCE_DIR}/microtune_xxxx.cc + ${CMAKE_CURRENT_SOURCE_DIR}/ppio_ppdev.cc + ${CMAKE_CURRENT_SOURCE_DIR}/gri_wavfile.cc +) + +######################################################################## +# Install runtime headers +######################################################################## +INSTALL(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/gr_histo_sink_f.h + ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_guts.h + ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink_f.h + ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink_x.h + ${CMAKE_CURRENT_SOURCE_DIR}/gr_trigger_mode.h + ${CMAKE_CURRENT_SOURCE_DIR}/i2c.h + ${CMAKE_CURRENT_SOURCE_DIR}/i2c_bitbang.h + ${CMAKE_CURRENT_SOURCE_DIR}/i2c_bbio.h + ${CMAKE_CURRENT_SOURCE_DIR}/i2c_bbio_pp.h + ${CMAKE_CURRENT_SOURCE_DIR}/microtune_4702.h + ${CMAKE_CURRENT_SOURCE_DIR}/microtune_4937.h + ${CMAKE_CURRENT_SOURCE_DIR}/microtune_eval_board_defs.h + ${CMAKE_CURRENT_SOURCE_DIR}/microtune_xxxx.h + ${CMAKE_CURRENT_SOURCE_DIR}/ppio_ppdev.h + ${CMAKE_CURRENT_SOURCE_DIR}/gri_wavfile.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "core_devel" +) + +######################################################################## +# Install swig headers +######################################################################## +IF(ENABLE_PYTHON) +INSTALL(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/io.i + ${CMAKE_CURRENT_SOURCE_DIR}/gr_histo_sink.i + ${CMAKE_CURRENT_SOURCE_DIR}/gr_oscope_sink.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "core_swig" +) +ENDIF(ENABLE_PYTHON) + +######################################################################## +# Handle triple-threat files that have cc, h, and i +######################################################################## +SET(gr_core_io_triple_threats + gr_file_sink + gr_file_sink_base + gr_file_source + gr_file_descriptor_sink + gr_file_descriptor_source + gr_message_sink + gr_message_source + microtune_xxxx_eval_board + microtune_4702_eval_board + microtune_4937_eval_board + ppio + sdr_1000 + gr_udp_sink + gr_udp_source + gr_wavfile_source + gr_wavfile_sink + gr_tagged_file_sink +) + +FOREACH(file_tt ${gr_core_io_triple_threats}) + LIST(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.cc) + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel") + IF(ENABLE_PYTHON) + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file_tt}.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig") + ENDIF(ENABLE_PYTHON) +ENDFOREACH(file_tt ${gr_core_io_triple_threats}) diff --git a/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc b/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc index 09fb6c826..11e0a8eb9 100644 --- a/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc +++ b/gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc @@ -34,6 +34,9 @@ #include <stdexcept> #include <stdio.h> +#ifdef HAVE_IO_H +#include <io.h> +#endif gr_file_descriptor_sink::gr_file_descriptor_sink (size_t itemsize, int fd) : gr_sync_block ("file_descriptor_sink", diff --git a/gnuradio-core/src/lib/io/gr_file_descriptor_sink.h b/gnuradio-core/src/lib/io/gr_file_descriptor_sink.h index fa8fa3f05..5e4cc6505 100644 --- a/gnuradio-core/src/lib/io/gr_file_descriptor_sink.h +++ b/gnuradio-core/src/lib/io/gr_file_descriptor_sink.h @@ -23,21 +23,22 @@ #ifndef INCLUDED_GR_FILE_DESCRIPTOR_SINK_H #define INCLUDED_GR_FILE_DESCRIPTOR_SINK_H +#include <gr_core_api.h> #include <gr_sync_block.h> class gr_file_descriptor_sink; typedef boost::shared_ptr<gr_file_descriptor_sink> gr_file_descriptor_sink_sptr; -gr_file_descriptor_sink_sptr gr_make_file_descriptor_sink (size_t itemsize, int fd); +GR_CORE_API gr_file_descriptor_sink_sptr gr_make_file_descriptor_sink (size_t itemsize, int fd); /*! * \brief Write stream to file descriptor. * \ingroup sink_blk */ -class gr_file_descriptor_sink : public gr_sync_block +class GR_CORE_API gr_file_descriptor_sink : public gr_sync_block { - friend gr_file_descriptor_sink_sptr gr_make_file_descriptor_sink (size_t itemsize, int fd); + friend GR_CORE_API gr_file_descriptor_sink_sptr gr_make_file_descriptor_sink (size_t itemsize, int fd); private: size_t d_itemsize; diff --git a/gnuradio-core/src/lib/io/gr_file_descriptor_source.cc b/gnuradio-core/src/lib/io/gr_file_descriptor_source.cc index 700ad4aef..334a57848 100644 --- a/gnuradio-core/src/lib/io/gr_file_descriptor_source.cc +++ b/gnuradio-core/src/lib/io/gr_file_descriptor_source.cc @@ -35,6 +35,9 @@ #include <stdio.h> #include <string.h> +#ifdef HAVE_IO_H +#include <io.h> +#endif gr_file_descriptor_source::gr_file_descriptor_source (size_t itemsize, int fd, diff --git a/gnuradio-core/src/lib/io/gr_file_descriptor_source.h b/gnuradio-core/src/lib/io/gr_file_descriptor_source.h index a9f117286..fa513fd25 100644 --- a/gnuradio-core/src/lib/io/gr_file_descriptor_source.h +++ b/gnuradio-core/src/lib/io/gr_file_descriptor_source.h @@ -23,12 +23,13 @@ #ifndef INCLUDED_GR_FILE_DESCRIPTOR_SOURCE_H #define INCLUDED_GR_FILE_DESCRIPTOR_SOURCE_H +#include <gr_core_api.h> #include <gr_sync_block.h> class gr_file_descriptor_source; typedef boost::shared_ptr<gr_file_descriptor_source> gr_file_descriptor_source_sptr; -gr_file_descriptor_source_sptr +GR_CORE_API gr_file_descriptor_source_sptr gr_make_file_descriptor_source (size_t itemsize, int fd, bool repeat = false); /*! @@ -36,9 +37,9 @@ gr_make_file_descriptor_source (size_t itemsize, int fd, bool repeat = false); * \ingroup source_blk */ -class gr_file_descriptor_source : public gr_sync_block +class GR_CORE_API gr_file_descriptor_source : public gr_sync_block { - friend gr_file_descriptor_source_sptr + friend GR_CORE_API gr_file_descriptor_source_sptr gr_make_file_descriptor_source (size_t itemsize, int fd, bool repeat); private: size_t d_itemsize; diff --git a/gnuradio-core/src/lib/io/gr_file_sink.h b/gnuradio-core/src/lib/io/gr_file_sink.h index b9ad06cd6..180cbef2a 100644 --- a/gnuradio-core/src/lib/io/gr_file_sink.h +++ b/gnuradio-core/src/lib/io/gr_file_sink.h @@ -23,22 +23,23 @@ #ifndef INCLUDED_GR_FILE_SINK_H #define INCLUDED_GR_FILE_SINK_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gr_file_sink_base.h> class gr_file_sink; typedef boost::shared_ptr<gr_file_sink> gr_file_sink_sptr; -gr_file_sink_sptr gr_make_file_sink(size_t itemsize, const char *filename); +GR_CORE_API gr_file_sink_sptr gr_make_file_sink(size_t itemsize, const char *filename); /*! * \brief Write stream to file. * \ingroup sink_blk */ -class gr_file_sink : public gr_sync_block, public gr_file_sink_base +class GR_CORE_API gr_file_sink : public gr_sync_block, public gr_file_sink_base { - friend gr_file_sink_sptr gr_make_file_sink(size_t itemsize, const char *filename); + friend GR_CORE_API gr_file_sink_sptr gr_make_file_sink(size_t itemsize, const char *filename); private: size_t d_itemsize; diff --git a/gnuradio-core/src/lib/io/gr_file_sink_base.h b/gnuradio-core/src/lib/io/gr_file_sink_base.h index 7b96cdb7f..6765dbad8 100644 --- a/gnuradio-core/src/lib/io/gr_file_sink_base.h +++ b/gnuradio-core/src/lib/io/gr_file_sink_base.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_GR_FILE_SINK_BASE_H #define INCLUDED_GR_FILE_SINK_BASE_H +#include <gr_core_api.h> #include <boost/thread.hpp> #include <cstdio> /*! * \brief Common base class for file sinks */ -class gr_file_sink_base +class GR_CORE_API gr_file_sink_base { protected: FILE *d_fp; // current FILE pointer diff --git a/gnuradio-core/src/lib/io/gr_file_source.h b/gnuradio-core/src/lib/io/gr_file_source.h index 5f5c2564e..6e8fc4074 100644 --- a/gnuradio-core/src/lib/io/gr_file_source.h +++ b/gnuradio-core/src/lib/io/gr_file_source.h @@ -23,12 +23,13 @@ #ifndef INCLUDED_GR_FILE_SOURCE_H #define INCLUDED_GR_FILE_SOURCE_H +#include <gr_core_api.h> #include <gr_sync_block.h> class gr_file_source; typedef boost::shared_ptr<gr_file_source> gr_file_source_sptr; -gr_file_source_sptr +GR_CORE_API gr_file_source_sptr gr_make_file_source (size_t itemsize, const char *filename, bool repeat = false); /*! @@ -36,9 +37,9 @@ gr_make_file_source (size_t itemsize, const char *filename, bool repeat = false) * \ingroup source_blk */ -class gr_file_source : public gr_sync_block +class GR_CORE_API gr_file_source : public gr_sync_block { - friend gr_file_source_sptr gr_make_file_source (size_t itemsize, + friend GR_CORE_API gr_file_source_sptr gr_make_file_source (size_t itemsize, const char *filename, bool repeat); private: diff --git a/gnuradio-core/src/lib/io/gr_histo_sink_f.h b/gnuradio-core/src/lib/io/gr_histo_sink_f.h index 8ba45ec55..934066ba2 100644 --- a/gnuradio-core/src/lib/io/gr_histo_sink_f.h +++ b/gnuradio-core/src/lib/io/gr_histo_sink_f.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_GR_HISTO_SINK_F_H #define INCLUDED_GR_HISTO_SINK_F_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gr_msg_queue.h> #include <gruel/thread.h> @@ -30,13 +31,13 @@ class gr_histo_sink_f; typedef boost::shared_ptr<gr_histo_sink_f> gr_histo_sink_f_sptr; -gr_histo_sink_f_sptr gr_make_histo_sink_f (gr_msg_queue_sptr msgq); +GR_CORE_API gr_histo_sink_f_sptr gr_make_histo_sink_f (gr_msg_queue_sptr msgq); /*! * \brief Histogram module. * \ingroup sink_blk */ -class gr_histo_sink_f : public gr_sync_block +class GR_CORE_API gr_histo_sink_f : public gr_sync_block { private: gr_msg_queue_sptr d_msgq; @@ -47,7 +48,7 @@ private: float *d_samps; gruel::mutex d_mutex; - friend gr_histo_sink_f_sptr gr_make_histo_sink_f (gr_msg_queue_sptr msgq); + friend GR_CORE_API gr_histo_sink_f_sptr gr_make_histo_sink_f (gr_msg_queue_sptr msgq); gr_histo_sink_f (gr_msg_queue_sptr msgq); void send_frame(void); void clear(void); diff --git a/gnuradio-core/src/lib/io/gr_message_sink.h b/gnuradio-core/src/lib/io/gr_message_sink.h index 5f1e5f91f..180055261 100644 --- a/gnuradio-core/src/lib/io/gr_message_sink.h +++ b/gnuradio-core/src/lib/io/gr_message_sink.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_GR_MESSAGE_SINK_H #define INCLUDED_GR_MESSAGE_SINK_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gr_message.h> #include <gr_msg_queue.h> @@ -30,7 +31,7 @@ class gr_message_sink; typedef boost::shared_ptr<gr_message_sink> gr_message_sink_sptr; -gr_message_sink_sptr gr_make_message_sink (size_t itemsize, +GR_CORE_API gr_message_sink_sptr gr_make_message_sink (size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block); @@ -38,14 +39,14 @@ gr_message_sink_sptr gr_make_message_sink (size_t itemsize, * \brief Gather received items into messages and insert into msgq * \ingroup sink_blk */ -class gr_message_sink : public gr_sync_block +class GR_CORE_API gr_message_sink : public gr_sync_block { private: size_t d_itemsize; gr_msg_queue_sptr d_msgq; bool d_dont_block; - friend gr_message_sink_sptr + friend GR_CORE_API gr_message_sink_sptr gr_make_message_sink(size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block); protected: diff --git a/gnuradio-core/src/lib/io/gr_message_source.h b/gnuradio-core/src/lib/io/gr_message_source.h index 46a808754..16a0f4474 100644 --- a/gnuradio-core/src/lib/io/gr_message_source.h +++ b/gnuradio-core/src/lib/io/gr_message_source.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_GR_MESSAGE_SOURCE_H #define INCLUDED_GR_MESSAGE_SOURCE_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gr_message.h> #include <gr_msg_queue.h> @@ -30,14 +31,14 @@ class gr_message_source; typedef boost::shared_ptr<gr_message_source> gr_message_source_sptr; -gr_message_source_sptr gr_make_message_source (size_t itemsize, int msgq_limit=0); -gr_message_source_sptr gr_make_message_source (size_t itemsize, gr_msg_queue_sptr msgq); +GR_CORE_API gr_message_source_sptr gr_make_message_source (size_t itemsize, int msgq_limit=0); +GR_CORE_API gr_message_source_sptr gr_make_message_source (size_t itemsize, gr_msg_queue_sptr msgq); /*! * \brief Turn received messages into a stream * \ingroup source_blk */ -class gr_message_source : public gr_sync_block +class GR_CORE_API gr_message_source : public gr_sync_block { private: size_t d_itemsize; @@ -46,9 +47,9 @@ class gr_message_source : public gr_sync_block unsigned d_msg_offset; bool d_eof; - friend gr_message_source_sptr + friend GR_CORE_API gr_message_source_sptr gr_make_message_source(size_t itemsize, int msgq_limit); - friend gr_message_source_sptr + friend GR_CORE_API gr_message_source_sptr gr_make_message_source(size_t itemsize, gr_msg_queue_sptr msgq); protected: diff --git a/gnuradio-core/src/lib/io/gr_oscope_guts.h b/gnuradio-core/src/lib/io/gr_oscope_guts.h index f39db62f6..3223d4e38 100644 --- a/gnuradio-core/src/lib/io/gr_oscope_guts.h +++ b/gnuradio-core/src/lib/io/gr_oscope_guts.h @@ -24,6 +24,7 @@ #ifndef INCLUDED_GR_OSCOPE_GUTS_H #define INCLUDED_GR_OSCOPE_GUTS_H +#include <gr_core_api.h> #include <gr_trigger_mode.h> #include <gr_msg_queue.h> @@ -40,7 +41,7 @@ * consist of 50% pre-trigger data and 50% post-trigger data. */ -class gr_oscope_guts { +class GR_CORE_API gr_oscope_guts { public: static const int MAX_CHANNELS = 8; private: diff --git a/gnuradio-core/src/lib/io/gr_oscope_sink_f.h b/gnuradio-core/src/lib/io/gr_oscope_sink_f.h index 1a8022b89..e3d1f65e5 100644 --- a/gnuradio-core/src/lib/io/gr_oscope_sink_f.h +++ b/gnuradio-core/src/lib/io/gr_oscope_sink_f.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_GR_OSCOPE_SINK_F_H #define INCLUDED_GR_OSCOPE_SINK_F_H +#include <gr_core_api.h> #include <gr_oscope_sink_x.h> #include <gr_msg_queue.h> class gr_oscope_sink_f; typedef boost::shared_ptr<gr_oscope_sink_x> gr_oscope_sink_f_sptr; -gr_oscope_sink_f_sptr gr_make_oscope_sink_f (double sampling_rate, gr_msg_queue_sptr msgq); +GR_CORE_API gr_oscope_sink_f_sptr gr_make_oscope_sink_f (double sampling_rate, gr_msg_queue_sptr msgq); /*! @@ -38,10 +39,10 @@ gr_oscope_sink_f_sptr gr_make_oscope_sink_f (double sampling_rate, gr_msg_queue_ * * Accepts multiple float streams. */ -class gr_oscope_sink_f : public gr_oscope_sink_x +class GR_CORE_API gr_oscope_sink_f : public gr_oscope_sink_x { private: - friend gr_oscope_sink_f_sptr + friend GR_CORE_API gr_oscope_sink_f_sptr gr_make_oscope_sink_f (double sampling_rate, gr_msg_queue_sptr msgq); gr_oscope_sink_f (double sampling_rate, gr_msg_queue_sptr msgq); diff --git a/gnuradio-core/src/lib/io/gr_oscope_sink_x.h b/gnuradio-core/src/lib/io/gr_oscope_sink_x.h index 62cf65100..aaff5870b 100644 --- a/gnuradio-core/src/lib/io/gr_oscope_sink_x.h +++ b/gnuradio-core/src/lib/io/gr_oscope_sink_x.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_GR_OSCOPE_SINK_X_H #define INCLUDED_GR_OSCOPE_SINK_X_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gr_trigger_mode.h> @@ -34,7 +35,7 @@ class gr_oscope_guts; * * Don't instantiate this. Use gr_oscope_sink_f or gr_oscope_sink_c instead. */ -class gr_oscope_sink_x : public gr_sync_block +class GR_CORE_API gr_oscope_sink_x : public gr_sync_block { protected: double d_sampling_rate; diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc index 154611c32..91618bad6 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc +++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc @@ -34,6 +34,10 @@ #include <iostream> #include <gr_tag_info.h> +#ifdef HAVE_IO_H +#include <io.h> +#endif + #ifdef O_BINARY #define OUR_O_BINARY O_BINARY #else diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h index 2e0a5c63a..da12dca78 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h +++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_GR_TAGGED_FILE_SINK_H #define INCLUDED_GR_TAGGED_FILE_SINK_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <cstdio> // for FILE class gr_tagged_file_sink; typedef boost::shared_ptr<gr_tagged_file_sink> gr_tagged_file_sink_sptr; -gr_tagged_file_sink_sptr gr_make_tagged_file_sink (size_t itemsize, +GR_CORE_API gr_tagged_file_sink_sptr gr_make_tagged_file_sink (size_t itemsize, double samp_rate); /*! @@ -37,9 +38,9 @@ gr_tagged_file_sink_sptr gr_make_tagged_file_sink (size_t itemsize, * \ingroup sink_blk */ -class gr_tagged_file_sink : public gr_sync_block +class GR_CORE_API gr_tagged_file_sink : public gr_sync_block { - friend gr_tagged_file_sink_sptr gr_make_tagged_file_sink (size_t itemsize, + friend GR_CORE_API gr_tagged_file_sink_sptr gr_make_tagged_file_sink (size_t itemsize, double samp_rate); private: diff --git a/gnuradio-core/src/lib/io/gr_udp_sink.h b/gnuradio-core/src/lib/io/gr_udp_sink.h index 421d514a4..e9d4f8c73 100644 --- a/gnuradio-core/src/lib/io/gr_udp_sink.h +++ b/gnuradio-core/src/lib/io/gr_udp_sink.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_GR_UDP_SINK_H #define INCLUDED_GR_UDP_SINK_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gruel/thread.h> class gr_udp_sink; typedef boost::shared_ptr<gr_udp_sink> gr_udp_sink_sptr; -gr_udp_sink_sptr +GR_CORE_API gr_udp_sink_sptr gr_make_udp_sink (size_t itemsize, const char *host, unsigned short port, int payload_size=1472, bool eof=true); @@ -47,9 +48,9 @@ gr_make_udp_sink (size_t itemsize, * \param eof Send zero-length packet on disconnect */ -class gr_udp_sink : public gr_sync_block +class GR_CORE_API gr_udp_sink : public gr_sync_block { - friend gr_udp_sink_sptr gr_make_udp_sink (size_t itemsize, + friend GR_CORE_API gr_udp_sink_sptr gr_make_udp_sink (size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof); diff --git a/gnuradio-core/src/lib/io/gr_udp_source.h b/gnuradio-core/src/lib/io/gr_udp_source.h index 5d30fad30..e2898981d 100644 --- a/gnuradio-core/src/lib/io/gr_udp_source.h +++ b/gnuradio-core/src/lib/io/gr_udp_source.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_GR_UDP_SOURCE_H #define INCLUDED_GR_UDP_SOURCE_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gruel/thread.h> class gr_udp_source; typedef boost::shared_ptr<gr_udp_source> gr_udp_source_sptr; -gr_udp_source_sptr gr_make_udp_source(size_t itemsize, const char *host, +GR_CORE_API gr_udp_source_sptr gr_make_udp_source(size_t itemsize, const char *host, unsigned short port, int payload_size=1472, bool eof=true, bool wait=true); @@ -52,9 +53,9 @@ gr_udp_source_sptr gr_make_udp_source(size_t itemsize, const char *host, * */ -class gr_udp_source : public gr_sync_block +class GR_CORE_API gr_udp_source : public gr_sync_block { - friend gr_udp_source_sptr gr_make_udp_source(size_t itemsize, + friend GR_CORE_API gr_udp_source_sptr gr_make_udp_source(size_t itemsize, const char *host, unsigned short port, int payload_size, diff --git a/gnuradio-core/src/lib/io/gr_wavfile_sink.h b/gnuradio-core/src/lib/io/gr_wavfile_sink.h index a1d6ed527..5fd3eaadc 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_sink.h +++ b/gnuradio-core/src/lib/io/gr_wavfile_sink.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_GR_WAVFILE_SINK_H #define INCLUDED_GR_WAVFILE_SINK_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <gr_file_sink_base.h> #include <boost/thread.hpp> @@ -36,7 +37,7 @@ typedef boost::shared_ptr<gr_wavfile_sink> gr_wavfile_sink_sptr; * \p sample_rate Sample rate [S/s] * \p bits_per_sample 16 or 8 bit, default is 16 */ -gr_wavfile_sink_sptr +GR_CORE_API gr_wavfile_sink_sptr gr_make_wavfile_sink (const char *filename, int n_channels, unsigned int sample_rate, @@ -50,10 +51,10 @@ gr_make_wavfile_sink (const char *filename, * * \ingroup sink_blk */ -class gr_wavfile_sink : public gr_sync_block +class GR_CORE_API gr_wavfile_sink : public gr_sync_block { private: - friend gr_wavfile_sink_sptr gr_make_wavfile_sink (const char *filename, + friend GR_CORE_API gr_wavfile_sink_sptr gr_make_wavfile_sink (const char *filename, int n_channels, unsigned int sample_rate, int bits_per_sample); diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.h b/gnuradio-core/src/lib/io/gr_wavfile_source.h index e434a6b4c..b300f2808 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_source.h +++ b/gnuradio-core/src/lib/io/gr_wavfile_source.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_GR_WAVFILE_SOURCE_H #define INCLUDED_GR_WAVFILE_SOURCE_H +#include <gr_core_api.h> #include <gr_sync_block.h> #include <cstdio> // for FILE class gr_wavfile_source; typedef boost::shared_ptr<gr_wavfile_source> gr_wavfile_source_sptr; -gr_wavfile_source_sptr +GR_CORE_API gr_wavfile_source_sptr gr_make_wavfile_source (const char *filename, bool repeat = false); /*! @@ -41,10 +42,10 @@ gr_make_wavfile_source (const char *filename, bool repeat = false); * \ingroup source_blk */ -class gr_wavfile_source : public gr_sync_block +class GR_CORE_API gr_wavfile_source : public gr_sync_block { private: - friend gr_wavfile_source_sptr gr_make_wavfile_source (const char *filename, + friend GR_CORE_API gr_wavfile_source_sptr gr_make_wavfile_source (const char *filename, bool repeat); gr_wavfile_source(const char *filename, bool repeat); diff --git a/gnuradio-core/src/lib/io/gri_wavfile.cc b/gnuradio-core/src/lib/io/gri_wavfile.cc index b8375edc2..8f1c6a2bb 100644 --- a/gnuradio-core/src/lib/io/gri_wavfile.cc +++ b/gnuradio-core/src/lib/io/gri_wavfile.cc @@ -160,25 +160,25 @@ gri_wavheader_parse(FILE *fp, return false; } - fread(&file_size, 1, 4, fp); + fresult = fread(&file_size, 1, 4, fp); fresult = fread(str_buf, 1, 8, fp); if (fresult != 8 || strncmp(str_buf, "WAVEfmt ", 8) || feof(fp)) { return false; } - fread(&fmt_hdr_skip, 1, 4, fp); + fresult = fread(&fmt_hdr_skip, 1, 4, fp); - fread(&compression_type, 1, 2, fp); + fresult = fread(&compression_type, 1, 2, fp); if (wav_to_host(compression_type) != VALID_COMPRESSION_TYPE) { return false; } - fread(&nchans, 1, 2, fp); - fread(&sample_rate, 1, 4, fp); - fread(&avg_bytes_per_sec, 1, 4, fp); - fread(&block_align, 1, 2, fp); - fread(&bits_per_sample, 1, 2, fp); + fresult = fread(&nchans, 1, 2, fp); + fresult = fread(&sample_rate, 1, 4, fp); + fresult = fread(&avg_bytes_per_sec, 1, 4, fp); + fresult = fread(&block_align, 1, 2, fp); + fresult = fread(&bits_per_sample, 1, 2, fp); if (ferror(fp)) { return false; @@ -204,7 +204,7 @@ gri_wavheader_parse(FILE *fp, return false; } - fread(&chunk_size, 1, 4, fp); + fresult = fread(&chunk_size, 1, 4, fp); if (ferror(fp)) { return false; } @@ -226,7 +226,9 @@ short int gri_wav_read_sample(FILE *fp, int bytes_per_sample) { int16_t buf = 0; - fread(&buf, bytes_per_sample, 1, fp); + size_t fresult; + + fresult = fread(&buf, bytes_per_sample, 1, fp); return (short) wav_to_host(buf); } diff --git a/gnuradio-core/src/lib/io/gri_wavfile.h b/gnuradio-core/src/lib/io/gri_wavfile.h index 2c7c1207c..2268474fb 100644 --- a/gnuradio-core/src/lib/io/gri_wavfile.h +++ b/gnuradio-core/src/lib/io/gri_wavfile.h @@ -23,6 +23,7 @@ // This file stores all the RIFF file type knowledge for the gr_wavfile_* // blocks. +#include <gr_core_api.h> #include <cstdio> /*! diff --git a/gnuradio-core/src/lib/io/i2c.h b/gnuradio-core/src/lib/io/i2c.h index e959f59a8..7d446dfa3 100644 --- a/gnuradio-core/src/lib/io/i2c.h +++ b/gnuradio-core/src/lib/io/i2c.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_I2C_H #define INCLUDED_I2C_H +#include <gr_core_api.h> #include <boost/shared_ptr.hpp> class i2c; @@ -31,7 +32,7 @@ typedef boost::shared_ptr<i2c> i2c_sptr; /*! * \brief abstract class for controlling i2c bus */ -class i2c { +class GR_CORE_API i2c { public: i2c () {} diff --git a/gnuradio-core/src/lib/io/i2c_bbio.h b/gnuradio-core/src/lib/io/i2c_bbio.h index c6b226e39..110a56555 100644 --- a/gnuradio-core/src/lib/io/i2c_bbio.h +++ b/gnuradio-core/src/lib/io/i2c_bbio.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_I2C_BBIO_H #define INCLUDED_I2C_BBIO_H +#include <gr_core_api.h> #include <boost/shared_ptr.hpp> class i2c_bbio; @@ -33,7 +34,7 @@ typedef boost::shared_ptr<i2c_bbio> i2c_bbio_sptr; * \brief abstract class that implements bit banging i/o for i2c bus. * \ingroup base */ -class i2c_bbio { +class GR_CORE_API i2c_bbio { public: i2c_bbio () {} diff --git a/gnuradio-core/src/lib/io/i2c_bbio_pp.h b/gnuradio-core/src/lib/io/i2c_bbio_pp.h index 5a99cdcd1..4a311a2c9 100644 --- a/gnuradio-core/src/lib/io/i2c_bbio_pp.h +++ b/gnuradio-core/src/lib/io/i2c_bbio_pp.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_I2C_BBIO_PP_H #define INCLUDED_I2C_BBIO_PP_H +#include <gr_core_api.h> #include "i2c_bbio.h" #include "ppio.h" @@ -33,8 +34,8 @@ * This class talks to the i2c bus on the microtune eval board using * the parallel port. This works for both the 4937 and 4702 boards. */ -class i2c_bbio_pp : public i2c_bbio { - friend i2c_bbio_sptr make_i2c_bbio_pp (ppio_sptr pp); +class GR_CORE_API i2c_bbio_pp : public i2c_bbio { + friend GR_CORE_API i2c_bbio_sptr make_i2c_bbio_pp (ppio_sptr pp); i2c_bbio_pp (ppio_sptr pp); public: @@ -50,7 +51,7 @@ class i2c_bbio_pp : public i2c_bbio { ppio_sptr d_pp; }; -i2c_bbio_sptr make_i2c_bbio_pp (ppio_sptr pp); +GR_CORE_API i2c_bbio_sptr make_i2c_bbio_pp (ppio_sptr pp); #endif /* INCLUDED_I2C_BBIO_PP_H */ diff --git a/gnuradio-core/src/lib/io/i2c_bitbang.h b/gnuradio-core/src/lib/io/i2c_bitbang.h index c9deb38ba..feb23b787 100644 --- a/gnuradio-core/src/lib/io/i2c_bitbang.h +++ b/gnuradio-core/src/lib/io/i2c_bitbang.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_I2C_BITBANG_H #define INCLUDED_I2C_BITBANG_H +#include <gr_core_api.h> #include <i2c.h> #include <i2c_bbio.h> @@ -30,8 +31,8 @@ * \brief class for controlling i2c bus * \ingroup base */ -class i2c_bitbang : public i2c { - friend i2c_sptr make_i2c_bitbang (i2c_bbio_sptr io); +class GR_CORE_API i2c_bitbang : public i2c { + friend GR_CORE_API i2c_sptr make_i2c_bitbang (i2c_bbio_sptr io); i2c_bitbang (i2c_bbio_sptr io); public: @@ -57,7 +58,7 @@ private: i2c_bbio_sptr d_io; }; -i2c_sptr make_i2c_bitbang (i2c_bbio_sptr io); +GR_CORE_API i2c_sptr make_i2c_bitbang (i2c_bbio_sptr io); #endif /* INCLUDED_I2C_BITBANG_H */ diff --git a/gnuradio-core/src/lib/io/microtune_4702.h b/gnuradio-core/src/lib/io/microtune_4702.h index 95c64abe7..fd8d89305 100644 --- a/gnuradio-core/src/lib/io/microtune_4702.h +++ b/gnuradio-core/src/lib/io/microtune_4702.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_MICROTUNE_4702_H #define INCLUDED_MICROTUNE_4702_H +#include <gr_core_api.h> #include <microtune_xxxx.h> /*! @@ -30,7 +31,7 @@ * \ingroup hardware */ -class microtune_4702 : public microtune_xxxx { +class GR_CORE_API microtune_4702 : public microtune_xxxx { public: microtune_4702 (i2c_sptr i2c, int i2c_addr); diff --git a/gnuradio-core/src/lib/io/microtune_4702_eval_board.h b/gnuradio-core/src/lib/io/microtune_4702_eval_board.h index 6e9726917..e3c07fdf9 100644 --- a/gnuradio-core/src/lib/io/microtune_4702_eval_board.h +++ b/gnuradio-core/src/lib/io/microtune_4702_eval_board.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_MICROTUNE_4702_EVAL_BOARD_H #define INCLUDED_MICROTUNE_4702_EVAL_BOARD_H +#include <gr_core_api.h> #include "microtune_xxxx_eval_board.h" /*! @@ -30,7 +31,7 @@ * \ingroup hardware */ -class microtune_4702_eval_board : public microtune_xxxx_eval_board { +class GR_CORE_API microtune_4702_eval_board : public microtune_xxxx_eval_board { public: microtune_4702_eval_board (int which_pp = 0); ~microtune_4702_eval_board (); diff --git a/gnuradio-core/src/lib/io/microtune_4937.h b/gnuradio-core/src/lib/io/microtune_4937.h index b263ceb0f..bc8a26c64 100644 --- a/gnuradio-core/src/lib/io/microtune_4937.h +++ b/gnuradio-core/src/lib/io/microtune_4937.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_MICROTUNE_4937_H #define INCLUDED_MICROTUNE_4937_H +#include <gr_core_api.h> #include <microtune_xxxx.h> /*! * \brief class for controlling microtune 4937 tuner module * \ingroup hardware */ -class microtune_4937 : public microtune_xxxx { +class GR_CORE_API microtune_4937 : public microtune_xxxx { public: microtune_4937 (i2c_sptr i2c, int i2c_addr = 0x61); virtual ~microtune_4937 (); diff --git a/gnuradio-core/src/lib/io/microtune_4937_eval_board.h b/gnuradio-core/src/lib/io/microtune_4937_eval_board.h index 154a7281a..09c00d116 100644 --- a/gnuradio-core/src/lib/io/microtune_4937_eval_board.h +++ b/gnuradio-core/src/lib/io/microtune_4937_eval_board.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_MICROTUNE_4937_EVAL_BOARD_H #define INCLUDED_MICROTUNE_4937_EVAL_BOARD_H +#include <gr_core_api.h> #include "microtune_xxxx_eval_board.h" /*! @@ -30,7 +31,7 @@ * \ingroup hardware */ -class microtune_4937_eval_board : public microtune_xxxx_eval_board { +class GR_CORE_API microtune_4937_eval_board : public microtune_xxxx_eval_board { public: microtune_4937_eval_board (int which_pp = 0); ~microtune_4937_eval_board (); diff --git a/gnuradio-core/src/lib/io/microtune_xxxx.h b/gnuradio-core/src/lib/io/microtune_xxxx.h index 4d5074a85..8b6ec25aa 100644 --- a/gnuradio-core/src/lib/io/microtune_xxxx.h +++ b/gnuradio-core/src/lib/io/microtune_xxxx.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_MICROTUNE_XXXX_H #define INCLUDED_MICROTUNE_XXXX_H +#include <gr_core_api.h> #include <boost/shared_ptr.hpp> class i2c; @@ -32,7 +33,7 @@ typedef boost::shared_ptr<i2c> i2c_sptr; * \brief abstract class for controlling microtune {4937,4702} tuner modules * \ingroup base */ -class microtune_xxxx { +class GR_CORE_API microtune_xxxx { public: microtune_xxxx () {} virtual ~microtune_xxxx (); diff --git a/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.cc b/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.cc index 668f04cad..14f2b8589 100644 --- a/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.cc +++ b/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.cc @@ -20,6 +20,10 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "microtune_xxxx_eval_board.h" #include "microtune_eval_board_defs.h" #include "microtune_xxxx.h" diff --git a/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.h b/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.h index 808075e55..08aa438c0 100644 --- a/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.h +++ b/gnuradio-core/src/lib/io/microtune_xxxx_eval_board.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_MICROTUNE_XXXX_EVAL_BOARD_H #define INCLUDED_MICROTUNE_XXXX_EVAL_BOARD_H +#include <gr_core_api.h> #include <boost/shared_ptr.hpp> class microtune_xxxx; @@ -37,7 +38,7 @@ typedef boost::shared_ptr<i2c> i2c_sptr; * \brief abstract class for controlling microtune xxxx eval board * \ingroup hardware */ -class microtune_xxxx_eval_board { +class GR_CORE_API microtune_xxxx_eval_board { public: microtune_xxxx_eval_board (int which_pp = 0); virtual ~microtune_xxxx_eval_board (); diff --git a/gnuradio-core/src/lib/io/ppio.h b/gnuradio-core/src/lib/io/ppio.h index e1a62e2a3..f7d14d52e 100644 --- a/gnuradio-core/src/lib/io/ppio.h +++ b/gnuradio-core/src/lib/io/ppio.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_PPIO_H #define INCLUDED_PPIO_H +#include <gr_core_api.h> #include <boost/shared_ptr.hpp> class ppio; @@ -34,7 +35,7 @@ typedef boost::shared_ptr<ppio> ppio_sptr; * \ingroup hardware */ -class ppio { +class GR_CORE_API ppio { public: ppio () {} virtual ~ppio (); @@ -55,7 +56,7 @@ class ppio { * Split out from class to make life easier for SWIG */ -ppio_sptr make_ppio (int which_pp); +GR_CORE_API ppio_sptr make_ppio (int which_pp); #endif /* INCLUDED_PPIO_H */ diff --git a/gnuradio-core/src/lib/io/ppio_ppdev.h b/gnuradio-core/src/lib/io/ppio_ppdev.h index b5abe3f0a..5d082d784 100644 --- a/gnuradio-core/src/lib/io/ppio_ppdev.h +++ b/gnuradio-core/src/lib/io/ppio_ppdev.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_PPIO_PPDEV_H #define INCLUDED_PPIO_PPDEV_H +#include <gr_core_api.h> #include <ppio.h> class ppio_ppdev; @@ -33,8 +34,8 @@ typedef boost::shared_ptr<ppio_ppdev> ppio_ppdev_sptr; * \ingroup hardware */ -class ppio_ppdev : public ppio { - friend ppio_ppdev_sptr make_ppio_ppdev (int which = 0); +class GR_CORE_API ppio_ppdev : public ppio { + friend GR_CORE_API ppio_ppdev_sptr make_ppio_ppdev (int which = 0); ppio_ppdev (int which = 0); public: diff --git a/gnuradio-core/src/lib/io/sdr_1000.h b/gnuradio-core/src/lib/io/sdr_1000.h index 113e85deb..6647fbba5 100644 --- a/gnuradio-core/src/lib/io/sdr_1000.h +++ b/gnuradio-core/src/lib/io/sdr_1000.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_SDR_1000_H #define INCLUDED_SDR_1000_H +#include <gr_core_api.h> #include <boost/shared_ptr.hpp> class ppio; @@ -36,7 +37,7 @@ enum { L_EXT = 0, L_BAND = 1, L_DDS0 = 2, L_DDS1 = 3 }; * \sa sdr_1000.py for a higher level interface. * \ingroup hardware */ -class sdr_1000_base { +class GR_CORE_API sdr_1000_base { ppio_sptr d_ppio; int d_shadow[4]; // shadow latches |