GNU Radio's HIQSDRTRX Package
sink_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 Stefan Goerg stefan@dl2stg.de
4  * Copyright 2021 Karsten Schmidt dg1vs@darc.de
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_HIQSDRTRX_SINK_IMPL_H
23 #define INCLUDED_HIQSDRTRX_SINK_IMPL_H
24 
25 #include <hiqsdrtrx/sink.h>
26 #include "source_impl.h"
27 
28 namespace gr
29 {
30  namespace hiqsdrtrx
31  {
32 
33  class sink_impl : public sink
34  {
35  private:
36  // Nothing to declare in this block.
37  void predistortion(double &re, double &im);
38  size_t d_itemsize;
39 
40  int d_payload_size; // maximum transmission unit (packet length)
41  bool d_eof; // send zero-length packet on disconnect
42  int d_socket; // handle to socket
43  bool d_connected; // are we connected?
44  double th1, th2;
45  //gruel::mutex d_mutex; // protects d_socket and d_connected
46  dcplx interp(double idx);
47 
48  public:
49  sink_impl(size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof);
50  ~sink_impl();
51 
52  // Where all the action really happens
53  int work(int noutput_items,
54  gr_vector_const_void_star &input_items,
55  gr_vector_void_star &output_items);
56  int payload_size() { return d_payload_size; }
57  void connect(const char *host, unsigned short port);
58  void disconnect();
59  };
60 
61  } // namespace hiqsdrtrx
62 } // namespace gr
63 
64 #endif /* INCLUDED_HIQSDRTRX_SINK_IMPL_H */
sink_impl(size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof)
Definition: sink.h:28
std::complex< double > dcplx
Definition: source_impl.h:29
<+description of block+>
Definition: sink.h:36
Definition: sink_impl.h:33
void connect(const char *host, unsigned short port)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
int payload_size()
Definition: sink_impl.h:56