diff options
Diffstat (limited to 'gr-blocks/include')
-rw-r--r-- | gr-blocks/include/blocks/CMakeLists.txt | 14 | ||||
-rw-r--r-- | gr-blocks/include/blocks/annotator_raw.h | 2 | ||||
-rw-r--r-- | gr-blocks/include/blocks/control_loop.h | 3 | ||||
-rw-r--r-- | gr-blocks/include/blocks/ctrlport_probe2_c.h | 64 | ||||
-rw-r--r-- | gr-blocks/include/blocks/ctrlport_probe_c.h | 62 | ||||
-rw-r--r-- | gr-blocks/include/blocks/message_sink.h | 5 | ||||
-rw-r--r-- | gr-blocks/include/blocks/message_source.h | 2 | ||||
-rw-r--r-- | gr-blocks/include/blocks/nop.h | 3 | ||||
-rw-r--r-- | gr-blocks/include/blocks/packed_to_unpacked_XX.h.t | 2 | ||||
-rw-r--r-- | gr-blocks/include/blocks/random_pdu.h | 51 | ||||
-rw-r--r-- | gr-blocks/include/blocks/rms_ff.h | 1 | ||||
-rw-r--r-- | gr-blocks/include/blocks/socket_pdu.h | 8 | ||||
-rw-r--r-- | gr-blocks/include/blocks/unpacked_to_packed_XX.h.t | 2 | ||||
-rw-r--r-- | gr-blocks/include/blocks/wavfile.h | 2 |
14 files changed, 209 insertions, 12 deletions
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index bcee973e37..e2b2792a76 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -65,8 +65,8 @@ endmacro(expand_h) # Invoke macro to generate various sources ######################################################################## expand_h(add_XX ss ii cc) -expand_h(add_const_XX ss ii ff cc) -expand_h(add_const_vXX ss ii ff cc) +expand_h(add_const_XX bb ss ii ff cc) +expand_h(add_const_vXX bb ss ii ff cc) expand_h(and_XX bb ss ii) expand_h(and_const_XX bb ss ii) expand_h(argmax_XX fs is ss) @@ -165,6 +165,7 @@ install(FILES pdu.h pdu_to_tagged_stream.h peak_detector2_fb.h + random_pdu.h plateau_detector_fb.h probe_rate.h regenerate_bb.h @@ -203,3 +204,12 @@ install(FILES DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) + +if(ENABLE_GR_CTRLPORT) +install(FILES + ctrlport_probe_c.h + ctrlport_probe2_c.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks + COMPONENT "blocks_devel" +) +endif(ENABLE_GR_CTRLPORT) diff --git a/gr-blocks/include/blocks/annotator_raw.h b/gr-blocks/include/blocks/annotator_raw.h index e835f0bd8d..ae273c2a46 100644 --- a/gr-blocks/include/blocks/annotator_raw.h +++ b/gr-blocks/include/blocks/annotator_raw.h @@ -48,7 +48,7 @@ namespace gr { static sptr make(size_t sizeof_stream_item); // insert a tag to be added - void add_tag(uint64_t offset, pmt::pmt_t key, pmt::pmt_t val); + virtual void add_tag(uint64_t offset, pmt::pmt_t key, pmt::pmt_t val) = 0; }; } /* namespace blocks */ diff --git a/gr-blocks/include/blocks/control_loop.h b/gr-blocks/include/blocks/control_loop.h index e59429a1f7..7c09f5915b 100644 --- a/gr-blocks/include/blocks/control_loop.h +++ b/gr-blocks/include/blocks/control_loop.h @@ -37,6 +37,7 @@ namespace gr { float d_alpha, d_beta; public: + control_loop(void) {} control_loop(float loop_bw, float max_freq, float min_freq); virtual ~control_loop(); @@ -98,7 +99,7 @@ namespace gr { * * \param bw (float) new bandwidth */ - void set_loop_bandwidth(float bw); + virtual void set_loop_bandwidth(float bw); /*! * \brief Set the loop damping factor diff --git a/gr-blocks/include/blocks/ctrlport_probe2_c.h b/gr-blocks/include/blocks/ctrlport_probe2_c.h new file mode 100644 index 0000000000..9a6034fcca --- /dev/null +++ b/gr-blocks/include/blocks/ctrlport_probe2_c.h @@ -0,0 +1,64 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012-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_CTRLPORT_PROBE2_C_H +#define INCLUDED_CTRLPORT_PROBE2_C_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief A ControlPort probe to export vectors of signals. + * + * This block acts as a sink in the flowgraph but also exports + * vectors of complex samples over ControlPort. This block holds + * the latest \p len number of complex samples so that every query + * by a ControlPort client will get the same length vector. + */ + class BLOCKS_API ctrlport_probe2_c : virtual public gr_sync_block + { + public: + // gr::blocks::ctrlport_probe2_c::sptr + typedef boost::shared_ptr<ctrlport_probe2_c> sptr; + + /*! + * \brief Make a ControlPort probe block. + * \param id A string ID to name the probe over ControlPort. + * \param desc A string describing the probe. + * \param len Number of samples to transmit. + */ + static sptr make(const std::string &id, const std::string &desc, int len); + + virtual std::vector<gr_complex> get() = 0; + + virtual void set_length(int len) = 0; + virtual int length() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_CTRLPORT_PROBE2_C_H */ + diff --git a/gr-blocks/include/blocks/ctrlport_probe_c.h b/gr-blocks/include/blocks/ctrlport_probe_c.h new file mode 100644 index 0000000000..92fe8c5600 --- /dev/null +++ b/gr-blocks/include/blocks/ctrlport_probe_c.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012-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_CTRLPORT_PROBE_C_H +#define INCLUDED_CTRLPORT_PROBE_C_H + +#include <blocks/api.h> +#include <gr_sync_block.h> +#include <rpcregisterhelpers.h> +#include <boost/thread/shared_mutex.hpp> + +namespace gr { + namespace blocks { + + /*! + * \brief A ControlPort probe to export vectors of signals. + * + * This block acts as a sink in the flowgraph but also exports + * vectors of complex samples over ControlPort. This block simply + * sends the current vector held in the work function when the + * queried by a ControlPort client. + */ + class BLOCKS_API ctrlport_probe_c : virtual public gr_sync_block + { + public: + // gr::blocks::ctrlport_probe_c::sptr + typedef boost::shared_ptr<ctrlport_probe_c> sptr; + + /*! + * \brief Make a ControlPort probe block. + * \param id A string ID to name the probe over ControlPort. + * \param desc A string describing the probe. + */ + static sptr make(const std::string &id, const std::string &desc); + + virtual std::vector<gr_complex> get() = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_CTRLPORT_GR_CTRLPORT_PROBE_C_H */ + diff --git a/gr-blocks/include/blocks/message_sink.h b/gr-blocks/include/blocks/message_sink.h index 5d14836dd4..5d3084d02d 100644 --- a/gr-blocks/include/blocks/message_sink.h +++ b/gr-blocks/include/blocks/message_sink.h @@ -40,7 +40,10 @@ namespace gr { // gr::blocks::message_sink::sptr typedef boost::shared_ptr<message_sink> sptr; - static sptr make (size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block); + static sptr make(size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block); + static sptr make(size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block, + const std::string& lengthtagname); + }; } /* namespace blocks */ diff --git a/gr-blocks/include/blocks/message_source.h b/gr-blocks/include/blocks/message_source.h index 5b55191880..cf4bafc22b 100644 --- a/gr-blocks/include/blocks/message_source.h +++ b/gr-blocks/include/blocks/message_source.h @@ -42,6 +42,8 @@ namespace gr { static sptr make(size_t itemsize, int msgq_limit=0); static sptr make(size_t itemsize, gr_msg_queue_sptr msgq); + static sptr make(size_t itemsize, gr_msg_queue_sptr msgq, + const std::string& lengthtagname); virtual gr_msg_queue_sptr msgq() const = 0; }; diff --git a/gr-blocks/include/blocks/nop.h b/gr-blocks/include/blocks/nop.h index b3135e1cc8..a75adad621 100644 --- a/gr-blocks/include/blocks/nop.h +++ b/gr-blocks/include/blocks/nop.h @@ -48,6 +48,9 @@ namespace gr { static sptr make(size_t sizeof_stream_item); virtual int nmsgs_received() const = 0; + + virtual int ctrlport_test() const = 0; + virtual void set_ctrlport_test(int x) = 0; }; } /* namespace blocks */ diff --git a/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t b/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t index 9ab8b8bdfc..c00a27527e 100644 --- a/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t +++ b/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t @@ -47,7 +47,7 @@ namespace gr { * processed. The right thing is done if bits_per_chunk is not a * power of two. * - * The combination of gr_packed_to_unpacked_XX_ followed by + * The combination of gr::blocks::packed_to_unpacked_XX_ followed by * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the * general case of mapping from a stream of bytes or shorts into * arbitrary float or complex symbols. diff --git a/gr-blocks/include/blocks/random_pdu.h b/gr-blocks/include/blocks/random_pdu.h new file mode 100644 index 0000000000..5a13f5eca6 --- /dev/null +++ b/gr-blocks/include/blocks/random_pdu.h @@ -0,0 +1,51 @@ +/* -*- 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. + */ + +#ifndef INCLUDED_BLOCKS_RANDOM_PDU_H +#define INCLUDED_BLOCKS_RANDOM_PDU_H + +#include <blocks/api.h> +#include <gr_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief Sends a random PDU at intervals + * \ingroup source_blk + */ + class BLOCKS_API random_pdu : virtual public gr_block + { + public: + // gr::blocks::random_pdu::sptr + typedef boost::shared_ptr<random_pdu> sptr; + + /*! + * \brief Construct a random PDU generator + */ + static sptr make(int mintime, int maxtime); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_RANDOM_PDU_H */ diff --git a/gr-blocks/include/blocks/rms_ff.h b/gr-blocks/include/blocks/rms_ff.h index 19fb0016d4..b945096907 100644 --- a/gr-blocks/include/blocks/rms_ff.h +++ b/gr-blocks/include/blocks/rms_ff.h @@ -19,6 +19,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ + #ifndef INCLUDED_BLOCKS_RMS_FF_H #define INCLUDED_BLOCKS_RMS_FF_H diff --git a/gr-blocks/include/blocks/socket_pdu.h b/gr-blocks/include/blocks/socket_pdu.h index 58d5ad2628..0ed64a2557 100644 --- a/gr-blocks/include/blocks/socket_pdu.h +++ b/gr-blocks/include/blocks/socket_pdu.h @@ -41,10 +41,10 @@ namespace gr { /*! * \brief Construct a SOCKET PDU interface - * \param type type of socket (TCP_SERVER, TCP_CLIENT, UDP_SERVER, UDP_CLIENT) - * \param addr address of host - * \param port port number to use - * \param MTU Maximum Transmission Unit size + * \param type "TCP_SERVER", "TCP_CLIENT", "UDP_SERVER", or "UDP_CLIENT" + * \param addr network address to use + * \param port network port to use + * \param MTU maximum transmission unit */ static sptr make(std::string type, std::string addr, std::string port, int MTU=10000); }; diff --git a/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t b/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t index 749f0e00f9..d570785a68 100644 --- a/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t +++ b/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t @@ -46,7 +46,7 @@ namespace gr { * output bytes or shorts are filled with valid input bits. The * right thing is done if bits_per_chunk is not a power of two. * - * The combination of gr_packed_to_unpacked_XX followed by + * The combination of gr::blocks::packed_to_unpacked_XX followed by * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the * general case of mapping from a stream of bytes or shorts into * arbitrary float or complex symbols. diff --git a/gr-blocks/include/blocks/wavfile.h b/gr-blocks/include/blocks/wavfile.h index 690f8fc22a..b852c01e2d 100644 --- a/gr-blocks/include/blocks/wavfile.h +++ b/gr-blocks/include/blocks/wavfile.h @@ -20,7 +20,7 @@ * Boston, MA 02110-1301, USA. */ -// This file stores all the RIFF file type knowledge for the gr_wavfile_* +// This file stores all the RIFF file type knowledge for the wavfile_* // blocks. #include <blocks/api.h> |