GNU Radio Radar Toolbox
usrp_echotimer_cc_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 Communications Engineering Lab, KIT.
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_RADAR_USRP_ECHOTIMER_CC_IMPL_H
22 #define INCLUDED_RADAR_USRP_ECHOTIMER_CC_IMPL_H
23 
25 
26 #include <uhd/utils/thread_priority.hpp>
27 #include <uhd/usrp/multi_usrp.hpp>
28 
29 namespace gr {
30  namespace radar {
31 
33  {
34  private:
35  // Nothing to declare in this block.
36 
37  protected:
38  int calculate_output_stream_length(const gr_vector_int &ninput_items);
39 
40  public:
41  usrp_echotimer_cc_impl(int samp_rate, float center_freq, int num_delay_samps,
42  std::string args_tx, std::string wire_tx, std::string clock_source_tx, std::string time_source_tx, std::string antenna_tx, float gain_tx,
43  float timeout_tx, float wait_tx, float lo_offset_tx,
44  std::string args_rx, std::string wire_rx, std::string clock_source_rx, std::string time_source_rx, std::string antenna_rx, float gain_rx,
45  float timeout_rx, float wait_rx, float lo_offset_rx,
46  const std::string& len_key);
48  void send();
49  void receive();
50  void set_num_delay_samps(int num_samps);
51  void set_rx_gain(float gain);
52  void set_tx_gain(float gain);
53 
57  std::vector<gr_complex> d_out_buffer;
58 
59  std::string d_args_tx, d_args_rx;
61  std::string d_wire_tx, d_wire_rx;
62  std::string d_antenna_tx, d_antenna_rx;
64  uhd::usrp::multi_usrp::sptr d_usrp_tx, d_usrp_rx;
65  uhd::tune_request_t d_tune_request_tx, d_tune_request_rx;
66  uhd::tx_streamer::sptr d_tx_stream;
67  uhd::rx_streamer::sptr d_rx_stream;
68  uhd::tx_metadata_t d_metadata_tx;
69  uhd::rx_metadata_t d_metadata_rx;
74 
75  uhd::time_spec_t d_time_now_tx, d_time_now_rx;
76 
77  gr::thread::thread d_thread_recv;
78  gr_complex *d_out_recv;
81 
82  gr::thread::thread d_thread_send;
83  gr_complex *d_in_send;
85 
86  // Where all the action really happens
87  int work(int noutput_items,
88  gr_vector_int &ninput_items,
89  gr_vector_const_void_star &input_items,
90  gr_vector_void_star &output_items);
91  };
92 
93  } // namespace radar
94 } // namespace gr
95 
96 #endif /* INCLUDED_RADAR_USRP_ECHOTIMER_CC_IMPL_H */
97 
int d_noutput_items_recv
Definition: usrp_echotimer_cc_impl.h:79
float d_timeout_tx
Definition: usrp_echotimer_cc_impl.h:71
std::string d_args_rx
Definition: usrp_echotimer_cc_impl.h:59
float d_gain_rx
Definition: usrp_echotimer_cc_impl.h:73
float d_wait_rx
Definition: usrp_echotimer_cc_impl.h:72
uhd::time_spec_t d_time_now_tx
Definition: usrp_echotimer_cc_impl.h:75
uhd::usrp::multi_usrp::sptr d_usrp_rx
Definition: usrp_echotimer_cc_impl.h:64
int d_num_delay_samps
Definition: usrp_echotimer_cc_impl.h:56
gr_complex * d_in_send
Definition: usrp_echotimer_cc_impl.h:83
usrp_echotimer_cc_impl(int samp_rate, float center_freq, int num_delay_samps, std::string args_tx, std::string wire_tx, std::string clock_source_tx, std::string time_source_tx, std::string antenna_tx, float gain_tx, float timeout_tx, float wait_tx, float lo_offset_tx, std::string args_rx, std::string wire_rx, std::string clock_source_rx, std::string time_source_rx, std::string antenna_rx, float gain_rx, float timeout_rx, float wait_rx, float lo_offset_rx, const std::string &len_key)
pmt::pmt_t d_time_val
Definition: usrp_echotimer_cc_impl.h:80
int calculate_output_stream_length(const gr_vector_int &ninput_items)
std::string d_args_tx
Definition: usrp_echotimer_cc_impl.h:59
uhd::rx_streamer::sptr d_rx_stream
Definition: usrp_echotimer_cc_impl.h:67
float d_center_freq
Definition: usrp_echotimer_cc_impl.h:55
std::string d_wire_tx
Definition: usrp_echotimer_cc_impl.h:61
int d_samp_rate
Definition: usrp_echotimer_cc_impl.h:54
float d_gain_tx
Definition: usrp_echotimer_cc_impl.h:73
uhd::time_spec_t d_time_now_rx
Definition: usrp_echotimer_cc_impl.h:75
std::string d_antenna_tx
Definition: usrp_echotimer_cc_impl.h:62
uhd::usrp::multi_usrp::sptr d_usrp_tx
Definition: usrp_echotimer_cc_impl.h:64
gr::thread::thread d_thread_recv
Definition: usrp_echotimer_cc_impl.h:77
pmt::pmt_t d_time_key
Definition: usrp_echotimer_cc_impl.h:80
std::string d_time_source_rx
Definition: usrp_echotimer_cc_impl.h:63
Definition: usrp_echotimer_cc_impl.h:32
std::string d_clock_source_rx
Definition: usrp_echotimer_cc_impl.h:60
Definition: crop_matrix_vcvc.h:28
int work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
std::vector< gr_complex > d_out_buffer
Definition: usrp_echotimer_cc_impl.h:57
int d_noutput_items_send
Definition: usrp_echotimer_cc_impl.h:84
uhd::tx_metadata_t d_metadata_tx
Definition: usrp_echotimer_cc_impl.h:68
uhd::tune_request_t d_tune_request_tx
Definition: usrp_echotimer_cc_impl.h:65
float d_timeout_rx
Definition: usrp_echotimer_cc_impl.h:71
pmt::pmt_t d_srcid
Definition: usrp_echotimer_cc_impl.h:80
std::string d_clock_source_tx
Definition: usrp_echotimer_cc_impl.h:60
uhd::rx_metadata_t d_metadata_rx
Definition: usrp_echotimer_cc_impl.h:69
double d_lo_offset_rx
Definition: usrp_echotimer_cc_impl.h:70
std::string d_wire_rx
Definition: usrp_echotimer_cc_impl.h:61
<+description of block+>
Definition: usrp_echotimer_cc.h:35
std::string d_antenna_rx
Definition: usrp_echotimer_cc_impl.h:62
std::string d_time_source_tx
Definition: usrp_echotimer_cc_impl.h:63
gr::thread::thread d_thread_send
Definition: usrp_echotimer_cc_impl.h:82
void set_num_delay_samps(int num_samps)
gr_complex * d_out_recv
Definition: usrp_echotimer_cc_impl.h:78
double d_lo_offset_tx
Definition: usrp_echotimer_cc_impl.h:70
float d_wait_tx
Definition: usrp_echotimer_cc_impl.h:72
uhd::tune_request_t d_tune_request_rx
Definition: usrp_echotimer_cc_impl.h:65
uhd::tx_streamer::sptr d_tx_stream
Definition: usrp_echotimer_cc_impl.h:66