Loading...
Searching...
No Matches
attr_updater.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2019 Analog Devices Inc.
* Author: Travis Collins <travis.collins@analog.com>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDED_IIO_ATTR_UPDATER_H
#define INCLUDED_IIO_ATTR_UPDATER_H
#include <gnuradio/block.h>
#include <gnuradio/iio/api.h>
namespace gr {
namespace iio {
/*!
* \brief Generic helper block to create message in a format that will be
* accepted by the IIO Attribute Sink Block
* \ingroup iio
*
* \details
* This block is a simple but flexible message source which can be connected to
* the IIO Attribute Sink block for easy interaction and real-time control of
* IIO driver attributes.
*/
class IIO_API attr_updater : virtual public gr::block
{
public:
typedef std::shared_ptr<attr_updater> sptr;
/*!
* \brief Return a shared_ptr to a new instance of iio::attr_updater.
*
* \param attribute String of name of attribute to be updated
* \param value String of value to update the attribute too
* \param interval_ms Integer of interval in milliseconds to produce
* messages. If zero outputs will be made only on callback changes
* and when the flowgraph starts
*/
static sptr
make(const std::string attribute, const std::string value, unsigned int interval_ms);
virtual void set_value(std::string value) = 0;
};
} // namespace iio
} // namespace gr
#endif /* INCLUDED_IIO_ATTR_UPDATER_H */
gr::block
The abstract base class for all 'terminal' processing blocks.
Definition gnuradio-runtime/include/gnuradio/block.h:63
gr::iio::attr_updater
Generic helper block to create message in a format that will be accepted by the IIO Attribute Sink Bl...
Definition attr_updater.h:31
gr::iio::attr_updater::set_value
virtual void set_value(std::string value)=0
gr::iio::attr_updater::make
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.
gr::iio::attr_updater::sptr
std::shared_ptr< attr_updater > sptr
Definition attr_updater.h:33
block.h
api.h
IIO_API
#define IIO_API
Definition gr-iio/include/gnuradio/iio/api.h:18
gr
GNU Radio logging wrapper.
Definition basic_block.h:29