/* -*- c++ -*- */ /* * Copyright 2014 Analog Devices Inc. * Author: Paul Cercueil * * SPDX-License-Identifier: GPL-3.0-or-later * */ #ifndef INCLUDED_IIO_DEVICE_SINK_IMPL_H #define INCLUDED_IIO_DEVICE_SINK_IMPL_H #include #include #include #include namespace gr { namespace iio { class device_sink_impl : public device_sink { private: void channel_write(const iio_channel* chn, const void* src, size_t len); std::vector d_tags; protected: iio_context* ctx; iio_device *dev, *phy; iio_buffer* buf; std::vector channel_list; unsigned int interpolation; unsigned int buffer_size; bool destroy_ctx; pmt::pmt_t d_len_tag_key; public: device_sink_impl(iio_context* ctx, bool destroy_ctx, const std::string& device, const std::vector& channels, const std::string& device_phy, const std::vector& params, unsigned int buffer_size = DEFAULT_BUFFER_SIZE, unsigned int interpolation = 0, bool cyclic = false); ~device_sink_impl(); void set_params(const std::vector& params); void set_len_tag_key(const std::string& len_tag_key) override; // Where all the action really happens int work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); void forecast(int noutput_items, gr_vector_int& ninput_items_required); }; } // namespace iio } // namespace gr #endif /* INCLUDED_IIO_DEVICE_SINK_IMPL_H */