GNU Radio's CYBERRADIO Package
NDR651_duc_sink_mk2.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /***************************************************************************
3  * \file NDR651_duc_sink_mk2.h
4  *
5  * \brief Digital upconverter (DUC) transmission sink block for the NDR651
6  * (Mk2).
7  *
8  * \author DA
9  * \copyright 2015 CyberRadio Solutions, Inc.
10  */
11 
12 #ifndef INCLUDED_CYBERRADIO_NDR651_DUC_SINK_MK2_H
13 #define INCLUDED_CYBERRADIO_NDR651_DUC_SINK_MK2_H
14 
15 #include <CyberRadio/api.h>
16 #include <gnuradio/sync_decimator.h>
17 
18 /*!
19  * \brief Provides GNU Radio blocks.
20  */
21 namespace gr
22 {
23  /*!
24  * \brief Provides GNU Radio blocks for CyberRadio Solutions products.
25  */
26  namespace CyberRadio
27  {
28  /*!
29  * \ingroup CyberRadioNDR651
30  *
31  * \brief Digital upconverter (DUC) transmission sink block for the
32  * NDR651 (Mk2).
33  *
34  * \details
35  * The NDR651_duc_sink_mk2 block represents a single digital upconverter
36  * (DUC) on an NDR651 radio, and transmits the signal sent to its
37  * input.
38  *
39  * To use more than one DUC on the NDR651, use multiple sinks,
40  * one for each DUC.
41  *
42  */
43  // Internal note -- although this class uses the sync_decimator
44  // block as a base, the processing performs no actual decimation
45  // on its input samples. The sync_decimator block simply consumes
46  // N input products to make one output product. So using it is a
47  // quick-and-dirty method of ensuring that the work() function has
48  // enough input samples to generate outgoing VITA 49 frames.
49  class CYBERRADIO_API NDR651_duc_sink_mk2 : virtual public gr::sync_decimator
50  {
51  public:
52  typedef boost::shared_ptr<NDR651_duc_sink_mk2> sptr;
53 
54  /*!
55  * \brief Creates an NDR651_duc_sink_mk2 block.
56  *
57  * \param radio_host_name The radio host name. If this is an empty
58  * string, then the block will not connect to a radio.
59  * \param radio_tcp_port The radio TCP port.
60  * \param tengig_iface_index The index of the 10 gig interface
61  * \param iq_scale_factor Scale factor for coverting I/Q data from
62  * complex input to native sample format.
63  * \param duc_channel The channel number for the DUC in use.
64  * \param duc_iface_string The interface string for the DUC in use.
65  * \param duc_rate_index The rate index for the DUC in use.
66  * \param duc_frequency The frequency offset for the DUC in use.
67  * \param duc_attenuation The attenuation for the DUC in use.
68  * \param duc_tx_channels The transmit channel mask for the DUC in use.
69  * \param duc_tx_frequency The transmit center frequency for the DUC in use.
70  * \param duc_tx_attenuation The transmit attenuation for the DUC in use.
71  * \param duc_stream_id The stream ID/UDP port for the DUC in use.
72  * \param config_tx The configured tx device
73  * \param debug Whether the block should produce debug output. Defaults to
74  * False.
75  * \param duchsPfThresh Pf Threshold
76  * \param duchsPeThresh Pe Threshold
77  * \param duchsPeriod period
78  * \param updatePE PE update flag
79  * \param txinv_mode transmitter mode
80  *
81  * \return A boost::shared_ptr<NDR651_duc_sink_mk2> representing the
82  * new block.
83  */
84  static sptr make(
85  /* For the radio in general */
86  const std::string& radio_host_name = "",
87  unsigned int radio_tcp_port = 8617,
88  unsigned int tengig_iface_index = 1,
89  float iq_scale_factor = 1.0,
90  /* For an individual DUC on the radio */
91  unsigned int duc_channel = 0,
92  const std::string& duc_iface_string = "eth0",
93  unsigned int duc_rate_index = 0,
94  long duc_frequency = 0,
95  float duc_attenuation = 0,
96  unsigned int duc_tx_channels = 0,
97  double duc_tx_frequency = 900,
98  unsigned int duc_tx_attenuation = 0,
99  unsigned int duc_stream_id = 40001,
100  bool config_tx = false,
101  bool debug = false,
102  unsigned int duchsPfThresh = 25,
103  unsigned int duchsPeThresh = 24,
104  unsigned int duchsPeriod = 10,
105  bool updatePE = false,
106  int txinv_mode = 0);
107 
108  /*!
109  * \brief Gets the radio host name.
110  * \return The radio host name.
111  */
112  virtual std::string get_radio_host_name() const = 0;
113 
114  /*!
115  * \brief Gets the radio TCP port.
116  * \return The port number.
117  */
118  virtual int get_radio_tcp_port() const = 0;
119 
120  /*!
121  * \brief Gets the 10GigE interface list for the radio.
122  * \return The interface list.
123  */
124  virtual std::vector<std::string> get_tengig_iface_list() const = 0;
125 
126  /*!
127  * \brief Sets the radio parameters.
128  * \param radio_host_name The radio host name. If this is an empty
129  * string, then the block will disconnect any existing connection
130  * and not attempt to connect to a radio.
131  * \param radio_tcp_port The radio TCP port.
132  * \param tengig_iface_list The list of 10GigE interface names.
133  */
134  virtual void set_radio_params(const std::string& radio_host_name,
135  int radio_tcp_port,
136  const std::vector<std::string>& tengig_iface_list) = 0;
137 
138  /*!
139  * \brief Gets the I/Q scale factor used for the radio.
140  * \return The scale factor.
141  */
142  virtual float get_iq_scale_factor() const = 0;
143 
144  /*!
145  * \brief Sets the I/Q scale factor used for the radio.
146  * \param iq_scale_factor The scale factor.
147  */
148  virtual void set_iq_scale_factor(float iq_scale_factor) = 0;
149 
150  /*!
151  * \brief Gets the channel number for the DUC
152  * in use.
153  * \return The channel number.
154  */
155  virtual int get_duc_channel() const = 0;
156 
157  /*!
158  * \brief Sets the channel number for the DUC
159  * in use.
160  * \param duc_channel The channel number for the DUC in use.
161  */
162  virtual void set_duc_channel(int duc_channel) = 0;
163 
164  /*!
165  * \brief Gets the interface name for the DUC in use.
166  * \return The interface name.
167  */
168  virtual std::string get_duc_iface_string() const = 0;
169 
170  /*!
171  * \brief Gets the interface index (one-based) for the DUC
172  * in use.
173  * \return The interface index.
174  */
175  virtual int get_duc_iface_index() const = 0;
176 
177  /*!
178  * \brief Sets the interface name for the DUC in use.
179  * \param duc_iface_string The interface string for the DUC in use.
180  */
181  virtual void set_duc_iface_string(const std::string& duc_iface_string) = 0;
182 
183  /*!
184  * \brief Gets the rate index (zero-based) for the DUC
185  * in use.
186  * \return The rate index.
187  */
188  virtual int get_duc_rate_index() const = 0;
189 
190  /*!
191  * \brief Sets the rate index (zero-based) for the DUC
192  * in use.
193  * \param duc_rate_index The rate index for the DUC in use.
194  */
195  virtual void set_duc_rate_index(int duc_rate_index) = 0;
196 
197  /*!
198  * \brief Gets the frequency offset for the DUC
199  * in use.
200  * \return The frequency offset.
201  */
202  virtual long get_duc_frequency() const = 0;
203 
204  /*!
205  * \brief Sets the frequency offset for the DUC
206  * in use.
207  * \param duc_frequency The frequency offset for the DUC in use.
208  */
209  virtual void set_duc_frequency(long duc_frequency) = 0;
210 
211  /*!
212  * \brief Sets the TX inversion mode for the DUC
213  * in use.
214  * \param txinv_mode 1 to enable tx inversion, 0 to disable.
215  */
216  virtual void set_duc_txinv_mode(int txinv_mode) = 0;
217 
218  /*!
219  * \brief Gets the attenuation for the DUC
220  * in use.
221  * \return The attenuation.
222  */
223  virtual float get_duc_attenuation() const = 0;
224 
225  /*!
226  * \brief Sets the attenuation for the DUC
227  * in use.
228  * \param duc_attenuation The attenuation for the DUC in use.
229  */
230  virtual void set_duc_attenuation(float duc_attenuation) = 0;
231 
232  /*!
233  * \brief Gets the transmit channel mask for the DUC
234  * in use.
235  * \return The transmit channel mask.
236  */
237  virtual unsigned int get_duc_tx_channels() const = 0;
238 
239  /*!
240  * \brief Sets the transmit channel mask for the DUC
241  * in use.
242  * \param duc_tx_channels The transmit channel mask for the DUC in use.
243  */
244  virtual void set_duc_tx_channels(unsigned int duc_tx_channels) = 0;
245 
246  /*!
247  * \brief Gets the transmit center frequency (in MHz) for
248  * the DUC in use.
249  * \return The transmit center frequency.
250  */
251  virtual double get_duc_tx_frequency() const = 0;
252 
253  /*!
254  * \brief Sets the transmit center frequency (in MHz) for
255  * the DUC in use.
256  * \param duc_tx_frequency The transmit center frequency for the DUC in use.
257  */
258  virtual void set_duc_tx_frequency(double duc_tx_frequency) = 0;
259 
260  /*!
261  * \brief Gets the transmit attenuation (in dB) for the DUC in use.
262  * \return The transmit attenuation.
263  */
264  virtual unsigned int get_duc_tx_attenuation() const = 0;
265 
266  /*!
267  * \brief Sets the transmit attenuation (in dB) for the DUC in use.
268  * \param duc_tx_attenuation The transmit attenuation for the DUC
269  * in use.
270  */
271  virtual void set_duc_tx_attenuation(unsigned int duc_tx_attenuation) = 0;
272 
273  /*!
274  * \brief Gets the VITA stream ID for the DUC.
275  * \return The stream ID.
276  */
277  virtual unsigned int get_duc_stream_id() const = 0;
278 
279  /*!
280  * \brief Sets the VITA stream ID for the DUC.
281  * \param duc_stream_id The stream ID.
282  */
283  virtual void set_duc_stream_id(unsigned int duc_stream_id) = 0;
284 
285  /*!
286  * \brief Gets the sample rate (in Hz) for the DUC in use,
287  * based on the rate index.
288  * \return The sample rate.
289  */
290  virtual long get_duc_sample_rate() const = 0;
291 
292  virtual void set_duchs_pf_threshold(int duchsPfThresh) = 0;
293  virtual void set_duchs_pe_threshold(int duchsPeThresh) = 0;
294  virtual void set_duchs_period(int duchsPeriod) = 0;
295  virtual void set_duchs_update_pe(bool updatePE) = 0;
296 
297  };
298 
299  } // namespace CyberRadio
300 
301 } // namespace gr
302 
303 #endif /* INCLUDED_CYBERRADIO_NDR651_DUC_SINK_MK2_H */
304 
#define CYBERRADIO_API
Definition: api.h:30
Digital upconverter (DUC) transmission sink block for the NDR651 (Mk2).
Definition: NDR651_duc_sink_mk2.h:49
Provides GNU Radio blocks.
Definition: NDR651_duc_sink_mk2.h:21
boost::shared_ptr< NDR651_duc_sink_mk2 > sptr
Definition: NDR651_duc_sink_mk2.h:52