GNU Radio's CYBERRADIO Package
NDR651_duc_sink_mk2_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /***************************************************************************
3  * \file NDR651_duc_sink_mk2_impl.h
4  *
5  * \brief Implementation of the digital upconverter (DUC) transmission
6  * sink block for the NDR651 (Mk2).
7  *
8  * \author DA
9  * \copyright 2015 CyberRadio Solutions, Inc.
10  */
11 
12 #ifndef INCLUDED_CYBERRADIO_NDR651_DUC_SINK_MK2_IMPL_H
13 #define INCLUDED_CYBERRADIO_NDR651_DUC_SINK_MK2_IMPL_H
14 
16 #include "LibCyberRadio/NDR651/DUCSink.h"
17 #include <stdio.h>
18 #include <sys/types.h>
19 #include <time.h>
20 
21 namespace gr {
22 namespace CyberRadio {
24 public:
26  /* For the radio in general */
27  const std::string &radio_host_name = "",
28  unsigned int radio_tcp_port = 8617, unsigned int tengig_iface_index = 1,
29  float iq_scale_factor = 1.0,
30  /* For an individual DUC on the radio */
31  unsigned int duc_channel = 1,
32  const std::string &duc_iface_string = "eth0",
33  unsigned int duc_rate_index = 0, long duc_frequency = 0,
34  float duc_attenuation = 0, unsigned int duc_tx_channels = 0,
35  double duc_tx_frequency = 900, unsigned int duc_tx_attenuation = 0,
36  unsigned int duc_stream_id = 40001, bool config_tx = false,
37  bool debug = false, unsigned int fc_update_rate = 20,
38  bool use_udp = false, bool use_ring_buffer = false,
39  unsigned int duchsPfThresh = 25, unsigned int duchsPeThresh = 24,
40  unsigned int duchsPeriod = 10, bool updatePE = false, int txinv_mode = 0);
42  std::string get_radio_host_name() const;
43  int get_radio_tcp_port() const;
44  std::vector<std::string> get_tengig_iface_list() const;
45  void set_radio_params(const std::string &radio_host_name, int radio_tcp_port,
46  const std::vector<std::string> &tengig_iface_list);
47  float get_iq_scale_factor() const;
48  void set_iq_scale_factor(float iq_scale_factor);
49  int get_duc_channel() const;
50  void set_duc_channel(int duc_channel);
51  std::string get_duc_iface_string() const;
52  int get_duc_iface_index() const;
53  void set_duc_iface_string(const std::string &duc_iface_string);
54  int get_duc_rate_index() const;
55  void set_duc_rate_index(int duc_rate_index);
56  long get_duc_frequency() const;
57  void set_duc_frequency(long duc_frequency);
58  void set_duc_txinv_mode(int txinv_mode);
59  float get_duc_attenuation() const;
60  void set_duc_attenuation(float duc_attenuation);
61  unsigned int get_duc_tx_channels() const;
62  void set_duc_tx_channels(unsigned int duc_tx_channels);
63  double get_duc_tx_frequency() const;
64  void set_duc_tx_frequency(double duc_tx_frequency);
65  unsigned int get_duc_tx_attenuation() const;
66  void set_duc_tx_attenuation(unsigned int duc_tx_attenuation);
67  unsigned int get_duc_stream_id() const;
68  void set_duc_stream_id(unsigned int duc_stream_id);
69  long get_duc_sample_rate() const;
70 
71  void set_duchs_pf_threshold(int duchsPfThresh);
72  void set_duchs_pe_threshold(int duchsPeThresh);
73  void set_duchs_period(int duchsPeriod);
74  void set_duchs_update_pe(bool updatePE);
75 
76  bool start();
77  bool stop();
78  // OVERRIDE
79  int work(int noutput_items, gr_vector_const_void_star &input_items,
80  gr_vector_void_star &output_items);
81 
82 private:
83  LibCyberRadio::NDR651::DUCSink *d_sink;
84 };
85 
86 } // namespace CyberRadio
87 
88 } // namespace gr
89 
90 #endif /* INCLUDED_CYBERRADIO_NDR651_DUC_SINK_MK2_IMPL_H */
float get_iq_scale_factor() const
Gets the I/Q scale factor used for the radio.
void set_duc_rate_index(int duc_rate_index)
Sets the rate index (zero-based) for the DUC in use.
int get_duc_iface_index() const
Gets the interface index (one-based) for the DUC in use.
int get_radio_tcp_port() const
Gets the radio TCP port.
NDR651_duc_sink_mk2_impl(const std::string &radio_host_name="", unsigned int radio_tcp_port=8617, unsigned int tengig_iface_index=1, float iq_scale_factor=1.0, unsigned int duc_channel=1, const std::string &duc_iface_string="eth0", unsigned int duc_rate_index=0, long duc_frequency=0, float duc_attenuation=0, unsigned int duc_tx_channels=0, double duc_tx_frequency=900, unsigned int duc_tx_attenuation=0, unsigned int duc_stream_id=40001, bool config_tx=false, bool debug=false, unsigned int fc_update_rate=20, bool use_udp=false, bool use_ring_buffer=false, unsigned int duchsPfThresh=25, unsigned int duchsPeThresh=24, unsigned int duchsPeriod=10, bool updatePE=false, int txinv_mode=0)
void set_duc_iface_string(const std::string &duc_iface_string)
Sets the interface name for the DUC in use.
long get_duc_sample_rate() const
Gets the sample rate (in Hz) for the DUC in use, based on the rate index.
unsigned int get_duc_tx_channels() const
Gets the transmit channel mask for the DUC in use.
void set_duc_stream_id(unsigned int duc_stream_id)
Sets the VITA stream ID for the DUC.
Definition: NDR651_duc_sink_mk2_impl.h:23
Digital upconverter (DUC) transmission sink block for the NDR651 (Mk2).
Definition: NDR651_duc_sink_mk2.h:49
int get_duc_rate_index() const
Gets the rate index (zero-based) for the DUC in use.
void set_duc_tx_channels(unsigned int duc_tx_channels)
Sets the transmit channel mask for the DUC in use.
long get_duc_frequency() const
Gets the frequency offset for the DUC in use.
std::string get_duc_iface_string() const
Gets the interface name for the DUC in use.
int get_duc_channel() const
Gets the channel number for the DUC in use.
void set_duc_attenuation(float duc_attenuation)
Sets the attenuation for the DUC in use.
float get_duc_attenuation() const
Gets the attenuation for the DUC in use.
Provides GNU Radio blocks.
Definition: NDR651_duc_sink_mk2.h:21
void set_duc_txinv_mode(int txinv_mode)
Sets the TX inversion mode for the DUC in use.
void set_duchs_pe_threshold(int duchsPeThresh)
void set_radio_params(const std::string &radio_host_name, int radio_tcp_port, const std::vector< std::string > &tengig_iface_list)
Sets the radio parameters.
void set_duc_tx_frequency(double duc_tx_frequency)
Sets the transmit center frequency (in MHz) for the DUC in use.
void set_iq_scale_factor(float iq_scale_factor)
Sets the I/Q scale factor used for the radio.
void set_duchs_pf_threshold(int duchsPfThresh)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
unsigned int get_duc_stream_id() const
Gets the VITA stream ID for the DUC.
std::string get_radio_host_name() const
Gets the radio host name.
double get_duc_tx_frequency() const
Gets the transmit center frequency (in MHz) for the DUC in use.
void set_duc_tx_attenuation(unsigned int duc_tx_attenuation)
Sets the transmit attenuation (in dB) for the DUC in use.
void set_duc_channel(int duc_channel)
Sets the channel number for the DUC in use.
unsigned int get_duc_tx_attenuation() const
Gets the transmit attenuation (in dB) for the DUC in use.
void set_duc_frequency(long duc_frequency)
Sets the frequency offset for the DUC in use.
std::vector< std::string > get_tengig_iface_list() const
Gets the 10GigE interface list for the radio.