diff options
Diffstat (limited to 'gr-uhd')
-rwxr-xr-x | gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py | 11 | ||||
-rwxr-xr-x | gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py | 6 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_sink.cc | 19 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_sink.h | 4 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_source.cc | 18 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_multi_usrp_source.h | 4 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_sink.cc | 19 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_sink.h | 4 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_source.cc | 18 | ||||
-rw-r--r-- | gr-uhd/lib/uhd_single_usrp_source.h | 4 |
10 files changed, 69 insertions, 38 deletions
diff --git a/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py b/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py index 8de4408d5..aa550157d 100755 --- a/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py +++ b/gr-uhd/grc/gen_uhd_multi_usrp_blocks_xml.py @@ -25,8 +25,17 @@ MAIN_TMPL = """\ <name>UHD: Multi USRP $sourk.title()</name> <key>uhd_multi_usrp_$(sourk)</key> <import>from gnuradio import uhd</import> - <make>uhd.multi_usrp_$(sourk)(\$dev_addr, uhd.io_type_t.\$type.type, \$nchan) + <make>uhd.multi_usrp_$(sourk)( + device_addr=\$dev_addr, + io_type=uhd.io_type_t.\$type.type, + num_channels=\$nchan, +) \#if \$sync() +clk_cfg = uhd.clock_config_t() +clk_cfg.ref_source = uhd.clock_config_t.REF_SMA +clk_cfg.pps_source = uhd.clock_config_t.PPS_SMA +clk_cfg.pps_polarity = uhd.clock_config_t.PPS_POS +self.\$(id).set_clock_config(clk_cfg, ~0); self.\$(id).set_time_unknown_pps(uhd.time_spec_t()) \#end if #for $m in range($max_mboards) diff --git a/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py b/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py index 5b87719e5..4d645afe1 100755 --- a/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py +++ b/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py @@ -25,7 +25,11 @@ MAIN_TMPL = """\ <name>UHD: Single USRP $sourk.title()</name> <key>uhd_single_usrp_$(sourk)</key> <import>from gnuradio import uhd</import> - <make>uhd.single_usrp_$(sourk)(\$dev_addr, uhd.io_type_t.\$type.type, \$nchan) + <make>uhd.single_usrp_$(sourk)( + device_addr=\$dev_addr, + io_type=uhd.io_type_t.\$type.type, + num_channels\$nchan, +) self.\$(id).set_subdev_spec(\$sd_spec) self.\$(id).set_samp_rate(\$samp_rate) #for $n in range($max_nchan) diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.cc b/gr-uhd/lib/uhd_multi_usrp_sink.cc index 202f12840..31dbac44f 100644 --- a/gr-uhd/lib/uhd_multi_usrp_sink.cc +++ b/gr-uhd/lib/uhd_multi_usrp_sink.cc @@ -37,12 +37,17 @@ uhd_multi_usrp_sink::uhd_multi_usrp_sink(gr_io_signature_sptr sig) class uhd_multi_usrp_sink_impl : public uhd_multi_usrp_sink{ public: uhd_multi_usrp_sink_impl( - const std::string &args, - const uhd::io_type_t &type, + const std::string &device_addr, + const uhd::io_type_t &io_type, size_t num_channels - ) : uhd_multi_usrp_sink(gr_make_io_signature(num_channels, num_channels, type.size)), _type(type), _nchan(num_channels) + ): + uhd_multi_usrp_sink(gr_make_io_signature( + num_channels, num_channels, io_type.size + )), + _type(io_type), + _nchan(num_channels) { - _dev = uhd::usrp::multi_usrp::make(args); + _dev = uhd::usrp::multi_usrp::make(device_addr); } void set_subdev_spec(const std::string &spec, size_t mboard){ @@ -165,11 +170,11 @@ protected: * Make UHD Multi USRP Sink **********************************************************************/ boost::shared_ptr<uhd_multi_usrp_sink> uhd_make_multi_usrp_sink( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels ){ return boost::shared_ptr<uhd_multi_usrp_sink>( - new uhd_multi_usrp_sink_impl(args, type, num_channels) + new uhd_multi_usrp_sink_impl(device_addr, io_type, num_channels) ); } diff --git a/gr-uhd/lib/uhd_multi_usrp_sink.h b/gr-uhd/lib/uhd_multi_usrp_sink.h index 13bba20fb..5dacc1fac 100644 --- a/gr-uhd/lib/uhd_multi_usrp_sink.h +++ b/gr-uhd/lib/uhd_multi_usrp_sink.h @@ -28,8 +28,8 @@ class uhd_multi_usrp_sink; boost::shared_ptr<uhd_multi_usrp_sink> uhd_make_multi_usrp_sink( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels ); diff --git a/gr-uhd/lib/uhd_multi_usrp_source.cc b/gr-uhd/lib/uhd_multi_usrp_source.cc index c10c08c50..1fcb57650 100644 --- a/gr-uhd/lib/uhd_multi_usrp_source.cc +++ b/gr-uhd/lib/uhd_multi_usrp_source.cc @@ -39,12 +39,16 @@ uhd_multi_usrp_source::uhd_multi_usrp_source(gr_io_signature_sptr sig) class uhd_multi_usrp_source_impl : public uhd_multi_usrp_source{ public: uhd_multi_usrp_source_impl( - const std::string &args, - const uhd::io_type_t &type, + const std::string &device_addr, + const uhd::io_type_t &io_type, size_t num_channels - ) : uhd_multi_usrp_source(gr_make_io_signature(num_channels, num_channels, type.size)), _type(type) + ): + uhd_multi_usrp_source(gr_make_io_signature( + num_channels, num_channels, io_type.size + )), + _type(io_type) { - _dev = uhd::usrp::multi_usrp::make(args); + _dev = uhd::usrp::multi_usrp::make(device_addr); } void set_subdev_spec(const std::string &spec, size_t mboard){ @@ -168,11 +172,11 @@ private: * Make UHD Multi USRP Source **********************************************************************/ boost::shared_ptr<uhd_multi_usrp_source> uhd_make_multi_usrp_source( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels ){ return boost::shared_ptr<uhd_multi_usrp_source>( - new uhd_multi_usrp_source_impl(args, type, num_channels) + new uhd_multi_usrp_source_impl(device_addr, io_type, num_channels) ); } diff --git a/gr-uhd/lib/uhd_multi_usrp_source.h b/gr-uhd/lib/uhd_multi_usrp_source.h index b94e53f01..36c4b6fdc 100644 --- a/gr-uhd/lib/uhd_multi_usrp_source.h +++ b/gr-uhd/lib/uhd_multi_usrp_source.h @@ -28,8 +28,8 @@ class uhd_multi_usrp_source; boost::shared_ptr<uhd_multi_usrp_source> uhd_make_multi_usrp_source( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels ); diff --git a/gr-uhd/lib/uhd_single_usrp_sink.cc b/gr-uhd/lib/uhd_single_usrp_sink.cc index 96c1dbdf4..4297a83ff 100644 --- a/gr-uhd/lib/uhd_single_usrp_sink.cc +++ b/gr-uhd/lib/uhd_single_usrp_sink.cc @@ -37,12 +37,17 @@ uhd_single_usrp_sink::uhd_single_usrp_sink(gr_io_signature_sptr sig) class uhd_single_usrp_sink_impl : public uhd_single_usrp_sink{ public: uhd_single_usrp_sink_impl( - const std::string &args, - const uhd::io_type_t &type, + const std::string &device_addr, + const uhd::io_type_t &io_type, size_t num_channels - ) : uhd_single_usrp_sink(gr_make_io_signature(num_channels, num_channels, type.size)), _type(type), _nchan(num_channels) + ): + uhd_single_usrp_sink(gr_make_io_signature( + num_channels, num_channels, io_type.size + )), + _type(io_type), + _nchan(num_channels) { - _dev = uhd::usrp::single_usrp::make(args); + _dev = uhd::usrp::single_usrp::make(device_addr); } void set_subdev_spec(const std::string &spec){ @@ -163,11 +168,11 @@ protected: * Make UHD Single USRP Sink **********************************************************************/ boost::shared_ptr<uhd_single_usrp_sink> uhd_make_single_usrp_sink( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels ){ return boost::shared_ptr<uhd_single_usrp_sink>( - new uhd_single_usrp_sink_impl(args, type, num_channels) + new uhd_single_usrp_sink_impl(device_addr, io_type, num_channels) ); } diff --git a/gr-uhd/lib/uhd_single_usrp_sink.h b/gr-uhd/lib/uhd_single_usrp_sink.h index bec788193..e83bb6ded 100644 --- a/gr-uhd/lib/uhd_single_usrp_sink.h +++ b/gr-uhd/lib/uhd_single_usrp_sink.h @@ -28,8 +28,8 @@ class uhd_single_usrp_sink; boost::shared_ptr<uhd_single_usrp_sink> uhd_make_single_usrp_sink( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels = 1 ); diff --git a/gr-uhd/lib/uhd_single_usrp_source.cc b/gr-uhd/lib/uhd_single_usrp_source.cc index 7c3694a99..27a788d96 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.cc +++ b/gr-uhd/lib/uhd_single_usrp_source.cc @@ -39,12 +39,16 @@ uhd_single_usrp_source::uhd_single_usrp_source(gr_io_signature_sptr sig) class uhd_single_usrp_source_impl : public uhd_single_usrp_source{ public: uhd_single_usrp_source_impl( - const std::string &args, - const uhd::io_type_t &type, + const std::string &device_addr, + const uhd::io_type_t &io_type, size_t num_channels - ) : uhd_single_usrp_source(gr_make_io_signature(num_channels, num_channels, type.size)), _type(type) + ): + uhd_single_usrp_source(gr_make_io_signature( + num_channels, num_channels, io_type.size + )), + _type(io_type) { - _dev = uhd::usrp::single_usrp::make(args); + _dev = uhd::usrp::single_usrp::make(device_addr); } void set_subdev_spec(const std::string &spec){ @@ -163,11 +167,11 @@ private: * Make UHD Single USRP Source **********************************************************************/ boost::shared_ptr<uhd_single_usrp_source> uhd_make_single_usrp_source( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels ){ return boost::shared_ptr<uhd_single_usrp_source>( - new uhd_single_usrp_source_impl(args, type, num_channels) + new uhd_single_usrp_source_impl(device_addr, io_type, num_channels) ); } diff --git a/gr-uhd/lib/uhd_single_usrp_source.h b/gr-uhd/lib/uhd_single_usrp_source.h index 196b7c675..c323fbd7e 100644 --- a/gr-uhd/lib/uhd_single_usrp_source.h +++ b/gr-uhd/lib/uhd_single_usrp_source.h @@ -28,8 +28,8 @@ class uhd_single_usrp_source; boost::shared_ptr<uhd_single_usrp_source> uhd_make_single_usrp_source( - const std::string &args, - const uhd::io_type_t::tid_t &type, + const std::string &device_addr, + const uhd::io_type_t::tid_t &io_type, size_t num_channels = 1 ); |