GNU Radio's HIQSDR Package
sink_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 Stefan Goerg stefan@dl2stg.de
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef INCLUDED_HIQSDR_SINK_IMPL_H
22 #define INCLUDED_HIQSDR_SINK_IMPL_H
23 
24 #include <hiqsdr/sink.h>
25 #include "source_impl.h"
26 
27 namespace gr {
28  namespace hiqsdr {
29 
30  class sink_impl : public sink
31  {
32  private:
33  void predistortion(double &re, double &im);
34  size_t d_itemsize;
35 
36  int d_payload_size; // maximum transmission unit (packet length)
37  bool d_eof; // send zero-length packet on disconnect
38  int d_socket; // handle to socket
39  bool d_connected; // are we connected?
40  double th1,th2;
41  //gruel::mutex d_mutex; // protects d_socket and d_connected
42  dcplx interp(double idx);
43 
44  public:
45  sink_impl(size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof);
46  ~sink_impl();
47 
48  // Where all the action really happens
49  int work(int noutput_items,
50  gr_vector_const_void_star &input_items,
51  gr_vector_void_star &output_items);
52  int payload_size() { return d_payload_size; }
53  void connect( const char *host, unsigned short port );
54  void disconnect();
55  };
56 
57  } // namespace hiqsdr
58 } // namespace gr
59 
60 #endif /* INCLUDED_HIQSDR_SINK_IMPL_H */
int payload_size()
Definition: sink_impl.h:52
void connect(const char *host, unsigned short port)
Definition: sink.h:28
std::complex< double > dcplx
Definition: source_impl.h:28
Definition: sink_impl.h:30
<+description of block+>
Definition: sink.h:36
sink_impl(size_t itemsize, const char *host, unsigned short port, int payload_size, bool eof)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)