GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
attr_sink.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2018 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_SINK_H
12 #define INCLUDED_IIO_ATTR_SINK_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/iio/api.h>
16 #include <gnuradio/iio/iio_types.h>
17 
18 namespace gr {
19 namespace iio {
20 
21 /*!
22  * \brief Generic writer for attributes of IIO devices
23  * \ingroup iio
24  *
25  * \details
26  * This block allow for updating of any IIO attribute that is writable. This
27  * includes channel, device, device buffer, device debug, and direct register
28  * attributes. All messages must be a pmt dictionary where the key is the
29  * attribute to update and the value is the value to be written. Messages can
30  * be an array of dictionaries or a single dictionary.
31  */
32 class IIO_API attr_sink : virtual public gr::block
33 {
34 public:
35  typedef std::shared_ptr<attr_sink> sptr;
36 
37  /*!
38  * \brief Return a shared_ptr to a new instance of iio::attr_sink.
39  *
40  * \param uri String of context uri
41  * \param device String of device name
42  * \param channel String of device name
43  * \param type Integer determining attribute type:
44  * 0: Channel attribute
45  * 1: Device attribute
46  * 2: Device buffer attribute
47  * 3: Device debug attribute
48  * 4: Direct register access
49  * \param output Boolean when True if channel attribute is an output
50  */
51  static sptr make(const std::string& uri,
52  const std::string& device,
53  const std::string& channel,
54  attr_type_t type,
55  bool output);
56 };
57 
58 } // namespace iio
59 } // namespace gr
60 
61 #endif /* INCLUDED_IIO_ATTR_SINK_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Generic writer for attributes of IIO devices.
Definition: attr_sink.h:33
static sptr make(const std::string &uri, const std::string &device, const std::string &channel, attr_type_t type, bool output)
Return a shared_ptr to a new instance of iio::attr_sink.
std::shared_ptr< attr_sink > sptr
Definition: attr_sink.h:35
#define IIO_API
Definition: gr-iio/include/gnuradio/iio/api.h:18
attr_type_t
Definition: iio_types.h:23
GNU Radio logging wrapper.
Definition: basic_block.h:29