diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-03-13 18:02:42 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-13 18:02:42 -0400 |
commit | 1c9d67fc220737873728310bd679d9e9cfab470a (patch) | |
tree | 5fbf8c157da3e938d9b90ebe720f3efbcef39215 /gr-blocks/include | |
parent | 1d8d1f111c41862d877686a89344a4a74f146cee (diff) | |
parent | 1bacc04f7a8f2f9c868a9934624683c7cefb2300 (diff) |
Merge branch 'master' into next
Conflicts:
gr-audio/lib/CMakeLists.txt
gr-blocks/include/blocks/CMakeLists.txt
gr-blocks/include/blocks/socket_pdu.h
gr-blocks/lib/CMakeLists.txt
gr-blocks/swig/blocks_swig.i
gr-comedi/src/CMakeLists.txt
gr-howto-write-a-block/lib/CMakeLists.txt
gr-noaa/lib/CMakeLists.txt
gr-qtgui/lib/CMakeLists.txt
gr-uhd/lib/CMakeLists.txt
gr-vocoder/lib/CMakeLists.txt
gr-wavelet/lib/CMakeLists.txt
Diffstat (limited to 'gr-blocks/include')
-rw-r--r-- | gr-blocks/include/blocks/CMakeLists.txt | 4 | ||||
-rw-r--r-- | gr-blocks/include/blocks/fxpt_nco.h | 2 | ||||
-rw-r--r-- | gr-blocks/include/blocks/mute_XX.h.t | 4 | ||||
-rw-r--r-- | gr-blocks/include/blocks/peak_detector_XX.h.t | 2 | ||||
-rw-r--r-- | gr-blocks/include/blocks/probe_rate.h | 60 | ||||
-rw-r--r-- | gr-blocks/include/blocks/udp_source.h | 84 |
6 files changed, 149 insertions, 7 deletions
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 648adccdbb..82d4179c72 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -124,9 +124,6 @@ install(FILES conjugate_cc.h deinterleave.h delay.h - file_descriptor_sink.h - file_descriptor_source.h - file_sink.h file_source.h file_meta_sink.h file_meta_source.h @@ -157,6 +154,7 @@ install(FILES pdu_to_tagged_stream.h peak_detector2_fb.h random_pdu.h + probe_rate.h regenerate_bb.h repeat.h rms_cf.h diff --git a/gr-blocks/include/blocks/fxpt_nco.h b/gr-blocks/include/blocks/fxpt_nco.h index 0faa731763..7db20fbb3a 100644 --- a/gr-blocks/include/blocks/fxpt_nco.h +++ b/gr-blocks/include/blocks/fxpt_nco.h @@ -41,7 +41,7 @@ namespace gr { * to the fxpt_vco can also be used to set or adjust the current * phase. */ - class BLOCKS_API fxpt_nco + class fxpt_nco { private: uint32_t d_phase; diff --git a/gr-blocks/include/blocks/mute_XX.h.t b/gr-blocks/include/blocks/mute_XX.h.t index 3033248c4e..2b1c8b9a4d 100644 --- a/gr-blocks/include/blocks/mute_XX.h.t +++ b/gr-blocks/include/blocks/mute_XX.h.t @@ -41,10 +41,10 @@ namespace gr { // gr::blocks::@NAME@::sptr typedef boost::shared_ptr<@NAME@> sptr; - static sptr make(bool mute); + static sptr make(bool mute=false); virtual bool mute() const = 0; - virtual void set_mute(bool mute) = 0; + virtual void set_mute(bool mute=false) = 0; }; } /* namespace blocks */ diff --git a/gr-blocks/include/blocks/peak_detector_XX.h.t b/gr-blocks/include/blocks/peak_detector_XX.h.t index 1c8ba0652f..fead53d208 100644 --- a/gr-blocks/include/blocks/peak_detector_XX.h.t +++ b/gr-blocks/include/blocks/peak_detector_XX.h.t @@ -38,7 +38,7 @@ namespace gr { * If a peak is detected, this block outputs a 1, * or it outputs 0's. */ - class GR_CORE_API @NAME@ : virtual public gr_sync_block + class BLOCKS_API @NAME@ : virtual public gr_sync_block { public: // gr::blocks::@NAME@::sptr diff --git a/gr-blocks/include/blocks/probe_rate.h b/gr-blocks/include/blocks/probe_rate.h new file mode 100644 index 0000000000..3401d2acd1 --- /dev/null +++ b/gr-blocks/include/blocks/probe_rate.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,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. + */ + +#ifndef INCLUDED_BLOCKS_PROBE_RATE_H +#define INCLUDED_BLOCKS_PROBE_RATE_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief throughput measurement + */ + class BLOCKS_API probe_rate : virtual public gr_sync_block + { + public: + // gr::blocks::probe_rate::sptr + typedef boost::shared_ptr<probe_rate> sptr; + + /*! + * \brief Make a throughput measurement block + * \param itemsize size of each stream item + * \param update_rate_ms minimum update time in milliseconds + * \param alpha gain for running average filter + */ + static sptr make(size_t itemsize, double update_rate_ms = 500.0, double alpha = 0.0001); + + virtual void set_alpha(double alpha) = 0; + + virtual double rate() = 0; + + virtual bool start() = 0; + virtual bool stop() = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_PROBE_RATE_H */ diff --git a/gr-blocks/include/blocks/udp_source.h b/gr-blocks/include/blocks/udp_source.h new file mode 100644 index 0000000000..b72db30db0 --- /dev/null +++ b/gr-blocks/include/blocks/udp_source.h @@ -0,0 +1,84 @@ +/* -*- c++ -*- */ +/* + * Copyright 2007-2010,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. + */ + +#ifndef INCLUDED_GR_UDP_SOURCE_H +#define INCLUDED_GR_UDP_SOURCE_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief Read stream from an UDP socket. + * \ingroup source_blk + */ + class BLOCKS_API udp_source : virtual public gr_sync_block + { + public: + // gr::blocks::udp_source::sptr + typedef boost::shared_ptr<udp_source> sptr; + + /*! + * \brief UDP Source Constructor + * + * \param itemsize The size (in bytes) of the item datatype + * \param host The name or IP address of the receiving host; can be + * NULL, None, or "0.0.0.0" to allow reading from any + * interface on the host + * \param port The port number on which to receive data; use 0 to + * have the system assign an unused port number + * \param payload_size UDP payload size by default set to 1472 = + * (1500 MTU - (8 byte UDP header) - (20 byte IP header)) + * \param eof Interpret zero-length packet as EOF (default: true) + */ + static sptr make(size_t itemsize, + const std::string &host, int port, + int payload_size=1472, + bool eof=true); + + /*! \brief Change the connection to a new destination + * + * \param host The name or IP address of the receiving host; use + * NULL or None to break the connection without closing + * \param port Destination port to connect to on receiving host + * + * Calls disconnect() to terminate any current connection first. + */ + virtual void connect(const std::string &host, int port) = 0; + + /*! \brief Cut the connection if we have one set up. + */ + virtual void disconnect() = 0; + + /*! \brief return the PAYLOAD_SIZE of the socket */ + virtual int payload_size() = 0; + + /*! \brief return the port number of the socket */ + virtual int get_port() = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_UDP_SOURCE_H */ |