GNU Radio Manual and C++ API Reference  v3.9.2.0-89-gb7c7001e
The Free & Open Software Radio Ecosystem
sink_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2021 Jeff Long
4  * Copyright 2018-2021 Libre Space Foundation <http://libre.space>
5  *
6  * SPDX-License-Identifier: GPL-3.0-or-later
7  */
8 
9 #ifndef INCLUDED_SOAPY_GR_SINK_IMPL_H
10 #define INCLUDED_SOAPY_GR_SINK_IMPL_H
11 
12 #include <functional>
13 
14 #include "block_impl.h"
15 #include <gnuradio/io_signature.h>
16 #include <gnuradio/soapy/sink.h>
17 
18 #include <SoapySDR/Device.hpp>
19 #include <SoapySDR/Modules.hpp>
20 #include <SoapySDR/Registry.hpp>
21 #include <SoapySDR/Version.hpp>
22 
23 namespace gr {
24 namespace soapy {
25 
26 /*!
27  * \brief Sink block implementation for SDR devices.
28  */
29 
30 class sink_impl : public sink, public block_impl
31 {
32 public:
33  sink_impl(const std::string& device,
34  const std::string& type,
35  size_t nchan,
36  const std::string& dev_args,
37  const std::string& stream_args,
38  const std::vector<std::string>& tune_args,
39  const std::vector<std::string>& other_settings);
40  ~sink_impl() override{};
41 
42  int general_work(int noutput_items,
43  gr_vector_int& ninput_items,
44  gr_vector_const_void_star& input_items,
45  gr_vector_void_star& output_items) override;
46 
47  void set_length_tag_name(const std::string& length_tag_name) override;
48 
49 private:
50  pmt::pmt_t d_length_tag_key = pmt::get_PMT_NIL();
51  long d_burst_remaining;
52 };
53 
54 } // namespace soapy
55 } // namespace gr
56 
57 #endif /* INCLUDED_SOAPY_GR_SINK_IMPL_H */
Base block implementation for SDR devices.
Definition: block_impl.h:35
Sink block implementation for SDR devices.
Definition: sink_impl.h:31
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
compute output items from input items
sink_impl(const std::string &device, const std::string &type, size_t nchan, const std::string &dev_args, const std::string &stream_args, const std::vector< std::string > &tune_args, const std::vector< std::string > &other_settings)
void set_length_tag_name(const std::string &length_tag_name) override
~sink_impl() override
Definition: sink_impl.h:40
Definition: gr-soapy/include/gnuradio/soapy/sink.h:41
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition: pmt.h:84
PMT_API pmt_t get_PMT_NIL()
std::vector< const void * > gr_vector_const_void_star
Definition: types.h:28
std::vector< void * > gr_vector_void_star
Definition: types.h:27
std::vector< int > gr_vector_int
Definition: types.h:23