GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tags_strobe.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_GR_TAGS_STROBE_H
24 #define INCLUDED_GR_TAGS_STROBE_H
25 
26 #include <gnuradio/blocks/api.h>
27 #include <gnuradio/sync_block.h>
28 
29 namespace gr {
30  namespace blocks {
31 
32  /*!
33  * \brief Send tags at defined interval
34  * \ingroup debug_blk
35  *
36  * \details
37  * Sends a tag with key 'strobe' and a user-defined value (as a
38  * PMT) every \p nsamps number of samples. Useful for
39  * testing/debugging the tags system.
40  *
41  * Because tags are sent with a data stream, this is a source
42  * block that acts identical to a null_source block.
43  */
44  class BLOCKS_API tags_strobe : virtual public sync_block
45  {
46  public:
47  // gr::blocks::tags_strobe::sptr
48  typedef boost::shared_ptr<tags_strobe> sptr;
49 
50  /*!
51  * Make a tags stobe block to send tags with value \p value
52  * every \p nsamps number of samples.
53  *
54  * \param sizeof_stream_item size of the stream items in bytes.
55  * \param value The value of the tags to send, as a PMT.
56  * \param nsamps the number of samples between each tag.
57  * \param key The tag key to sent
58  */
59  static sptr make(size_t sizeof_stream_item,
60  pmt::pmt_t value, uint64_t nsamps, pmt::pmt_t key = pmt::intern("strobe"));
61 
62  /*!
63  * Reset the value of the tags being sent.
64  * \param value The value of the tags to send as a PMT.
65  */
66  virtual void set_value(pmt::pmt_t value) = 0;
67 
68  /*!
69  * Change the tag key we are sending
70  */
71  virtual void set_key(pmt::pmt_t key) = 0;
72 
73  /*!
74  * Get the value of the tags being sent.
75  */
76  virtual pmt::pmt_t value() const = 0;
77 
78  /*!
79  * Get the key of the tags being sent.
80  */
81  virtual pmt::pmt_t key() const = 0;
82 
83  /*!
84  * Reset the sending interval.
85  * \param nsamps the number of samples between each tag
86  */
87  virtual void set_nsamps(uint64_t nsamps) = 0;
88 
89  /*!
90  * Get the number of samples between the tag strobe.
91  */
92  virtual uint64_t nsamps() const = 0;
93 
94  };
95 
96  } /* namespace blocks */
97 } /* namespace gr */
98 
99 #endif /* INCLUDED_GR_TAGS_STROBE_H */
PMT_API pmt_t intern(const std::string &s)
Alias for pmt_string_to_symbol.
Include this header to use the message passing features.
Definition: logger.h:131
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:30
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
boost::shared_ptr< tags_strobe > sptr
Definition: tags_strobe.h:48
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:56
Send tags at defined interval.
Definition: tags_strobe.h:44