GNU Radio C++ API Reference 3.10.11.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_GR_TAGS_STROBE_H
12#define INCLUDED_GR_TAGS_STROBE_H
13
14#include <gnuradio/blocks/api.h>
15#include <gnuradio/sync_block.h>
16
17namespace gr {
18namespace blocks {
19
20/*!
21 * \brief Send tags at defined interval
22 * \ingroup debug_blk
23 *
24 * \details
25 * Sends a tag with key 'strobe' and a user-defined value (as a
26 * PMT) every \p nsamps number of samples. Useful for
27 * testing/debugging the tags system.
28 *
29 * Because tags are sent with a data stream, this is a source
30 * block that acts identical to a null_source block.
31 */
32class BLOCKS_API tags_strobe : virtual public sync_block
33{
34public:
35 // gr::blocks::tags_strobe::sptr
36 typedef std::shared_ptr<tags_strobe> sptr;
37
38 /*!
39 * Make a tags stobe block to send tags with value \p value
40 * every \p nsamps number of samples.
41 *
42 * \param sizeof_stream_item size of the stream items in bytes.
43 * \param value The value of the tags to send, as a PMT.
44 * \param nsamps the number of samples between each tag.
45 * \param key The tag key to sent
46 */
47 static sptr make(size_t sizeof_stream_item,
48 pmt::pmt_t value,
49 uint64_t nsamps,
50 pmt::pmt_t key = pmt::intern("strobe"));
51
52 /*!
53 * Reset the value of the tags being sent.
54 * \param value The value of the tags to send as a PMT.
55 */
56 virtual void set_value(pmt::pmt_t value) = 0;
57
58 /*!
59 * Change the tag key we are sending
60 */
61 virtual void set_key(pmt::pmt_t key) = 0;
62
63 /*!
64 * Get the value of the tags being sent.
65 */
66 virtual pmt::pmt_t value() const = 0;
67
68 /*!
69 * Get the key of the tags being sent.
70 */
71 virtual pmt::pmt_t key() const = 0;
72
73 /*!
74 * Reset the sending interval.
75 * \param nsamps the number of samples between each tag
76 */
77 virtual void set_nsamps(uint64_t nsamps) = 0;
78
79 /*!
80 * Get the number of samples between the tag strobe.
81 */
82 virtual uint64_t nsamps() const = 0;
83};
84
85} /* namespace blocks */
86} /* namespace gr */
87
88#endif /* INCLUDED_GR_TAGS_STROBE_H */
Send tags at defined interval.
Definition tags_strobe.h:33
static sptr make(size_t sizeof_stream_item, pmt::pmt_t value, uint64_t nsamps, pmt::pmt_t key=pmt::intern("strobe"))
virtual pmt::pmt_t key() const =0
virtual void set_nsamps(uint64_t nsamps)=0
virtual uint64_t nsamps() const =0
virtual pmt::pmt_t value() const =0
std::shared_ptr< tags_strobe > sptr
Definition tags_strobe.h:36
virtual void set_key(pmt::pmt_t key)=0
virtual void set_value(pmt::pmt_t value)=0
synchronous 1:1 input to output with history
Definition sync_block.h:26
#define BLOCKS_API
Definition gr-blocks/include/gnuradio/blocks/api.h:18
GNU Radio logging wrapper.
Definition basic_block.h:29
PMT_API pmt_t intern(const std::string &s)
Alias for pmt_string_to_symbol.
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition pmt.h:83