GNU Radio's IIO Package
attr_sink_impl.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  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this software; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef INCLUDED_IIO_ATTR_SINK_IMPL_H
23 #define INCLUDED_IIO_ATTR_SINK_IMPL_H
24 
25 #include <iio.h>
26 #include <iio/attr_sink.h>
27 #include <pmt/pmt.h>
28 
29 #include "device_source_impl.h"
30 
31 namespace gr {
32  namespace iio {
33 
34  class attr_sink_impl : public attr_sink
35  {
36  private:
37  std::string device;
38  std::string channel;
39  std::string uri;
40  int type;
41  bool output;
42  bool required_enable;
43 
44  protected:
45  struct iio_context *ctx;
46  struct iio_device *dev;
47  struct iio_channel * chan;
48 
49  public:
50  attr_sink_impl(const std::string &uri, const std::string &device,
51  const std::string &channel, int type, bool output, bool required_enable);
53 
54  void write_attribute(pmt::pmt_t pdu);
55  };
56 
57  } // namespace iio
58 } // namespace gr
59 
60 #endif /* INCLUDED_IIO_ATTR_SINK_IMPL_H */
<+description of block+>
Definition: attr_sink.h:37
struct iio_device * dev
Definition: attr_sink_impl.h:46
Definition: attr_sink.h:29
attr_sink_impl(const std::string &uri, const std::string &device, const std::string &channel, int type, bool output, bool required_enable)
void write_attribute(pmt::pmt_t pdu)
struct iio_context * ctx
Definition: attr_sink_impl.h:45
Definition: attr_sink_impl.h:34
struct iio_channel * chan
Definition: attr_sink_impl.h:47