GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
attr_updater.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 Analog Devices Inc.
4  * Author: Travis Collins <travis.collins@analog.com>
5  *
6  * SPDX-License-Identifier: GPL-3.0-or-later
7  *
8  */
9 
10 
11 #ifndef INCLUDED_IIO_ATTR_UPDATER_H
12 #define INCLUDED_IIO_ATTR_UPDATER_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/iio/api.h>
16 
17 namespace gr {
18 namespace iio {
19 
20 /*!
21  * \brief Generic helper block to create message in a format that will be
22  * accepted by the IIO Attribute Sink Block
23  * \ingroup iio
24  *
25  * \details
26  * This block is a simple but flexible message source which can be connected to
27  * the IIO Attribute Sink block for easy interaction and real-time control of
28  * IIO driver attributes.
29  */
30 class IIO_API attr_updater : virtual public gr::block
31 {
32 public:
33  typedef std::shared_ptr<attr_updater> sptr;
34 
35  /*!
36  * \brief Return a shared_ptr to a new instance of iio::attr_updater.
37  *
38  * \param attribute String of name of attribute to be updated
39  * \param value String of value to update the attribute too
40  * \param interval_ms Integer of interval in milliseconds to produce
41  * messages. If zero outputs will be made only on callback changes
42  * and when the flowgraph starts
43  */
44  static sptr
45  make(const std::string attribute, const std::string value, unsigned int interval_ms);
46 
47  virtual void set_value(std::string value) = 0;
48 };
49 
50 } // namespace iio
51 } // namespace gr
52 
53 #endif /* INCLUDED_IIO_ATTR_UPDATER_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Generic helper block to create message in a format that will be accepted by the IIO Attribute Sink Bl...
Definition: attr_updater.h:31
virtual void set_value(std::string value)=0
static sptr make(const std::string attribute, const std::string value, unsigned int interval_ms)
Return a shared_ptr to a new instance of iio::attr_updater.
std::shared_ptr< attr_updater > sptr
Definition: attr_updater.h:33
#define IIO_API
Definition: gr-iio/include/gnuradio/iio/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29