GNU Radio Manual and C++ API Reference 3.10.3.0
The Free & Open Software Radio Ecosystem
attr_updater_impl.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#ifndef INCLUDED_IIO_ATTR_UPDATER_IMPL_H
11#define INCLUDED_IIO_ATTR_UPDATER_IMPL_H
12
14
15#include <mutex>
16#include <string>
17
18namespace gr {
19namespace iio {
20
22{
23private:
24 const std::string d_attribute;
25 std::string d_value;
26 const pmt::pmt_t d_port;
27 unsigned int d_interval_ms;
28 bool d_finished;
29 pmt::pmt_t d_msg;
30 std::mutex d_mtx;
31 std::shared_ptr<gr::thread::thread> d_thread;
32
33 void run();
34
35public:
36 attr_updater_impl(const std::string attribute,
37 const std::string value,
38 unsigned int interval_ms);
40
41 void set_value(std::string value);
42 bool start();
43 bool stop();
44};
45
46} // namespace iio
47} // namespace gr
48
49#endif /* INCLUDED_IIO_ATTR_UPDATER_IMPL_H */
Definition: attr_updater_impl.h:22
attr_updater_impl(const std::string attribute, const std::string value, unsigned int interval_ms)
bool start()
Called to enable drivers, etc for i/o devices.
bool stop()
Called to disable drivers, etc for i/o devices.
void set_value(std::string value)
Generic helper block to create message in a format that will be accepted by the IIO Attribute Sink Bl...
Definition: attr_updater.h:31
boost::mutex mutex
Definition: thread.h:37
GNU Radio logging wrapper.
Definition: basic_block.h:29
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition: pmt.h:83