summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2010-09-23 19:05:10 -0700
committerJosh Blum2010-09-23 19:05:10 -0700
commit1fe3790faed05b92ca4ad3a27da6eb23632d7e57 (patch)
treea0cacc33e46459853e7d51613bcf393fed54f271
parent2831c9313d09685090cea531a177469b57792c9a (diff)
downloadgnuradio-1fe3790faed05b92ca4ad3a27da6eb23632d7e57.tar.gz
gnuradio-1fe3790faed05b92ca4ad3a27da6eb23632d7e57.tar.bz2
gnuradio-1fe3790faed05b92ca4ad3a27da6eb23632d7e57.zip
uhd: multi channel single usrp source and sink working
-rwxr-xr-xgr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py2
-rw-r--r--gr-uhd/lib/uhd_single_usrp_sink.cc10
-rw-r--r--gr-uhd/lib/uhd_single_usrp_sink.h3
-rw-r--r--gr-uhd/lib/uhd_single_usrp_source.cc10
-rw-r--r--gr-uhd/lib/uhd_single_usrp_source.h3
5 files changed, 17 insertions, 11 deletions
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 1ad3c0927..5b3cb5b5a 100755
--- a/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py
+++ b/gr-uhd/grc/gen_uhd_single_usrp_blocks_xml.py
@@ -26,7 +26,7 @@ MAIN_TMPL = """\
<key>uhd_single_usrp_$(sourk)</key>
<category>UHD</category>
<import>from gnuradio import uhd</import>
- <make>uhd.single_usrp_$(sourk)(\$dev_addr, uhd.io_type_t.\$type.type)
+ <make>uhd.single_usrp_$(sourk)(\$dev_addr, uhd.io_type_t.\$type.type, \$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_single_usrp_sink.cc b/gr-uhd/lib/uhd_single_usrp_sink.cc
index 1cd5afc87..8cb3726d1 100644
--- a/gr-uhd/lib/uhd_single_usrp_sink.cc
+++ b/gr-uhd/lib/uhd_single_usrp_sink.cc
@@ -39,8 +39,9 @@ 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
- ) : uhd_single_usrp_sink(gr_make_io_signature(1, 1, type.size)), _type(type)
+ const uhd::io_type_t &type,
+ size_t num_channels
+ ) : uhd_single_usrp_sink(gr_make_io_signature(num_channels, num_channels, type.size)), _type(type)
{
_dev = uhd::usrp::single_usrp::make(args);
}
@@ -143,9 +144,10 @@ protected:
**********************************************************************/
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 uhd::io_type_t::tid_t &type,
+ size_t num_channels
){
return boost::shared_ptr<uhd_single_usrp_sink>(
- new uhd_single_usrp_sink_impl(args, type)
+ new uhd_single_usrp_sink_impl(args, type, num_channels)
);
}
diff --git a/gr-uhd/lib/uhd_single_usrp_sink.h b/gr-uhd/lib/uhd_single_usrp_sink.h
index 61417168a..bec788193 100644
--- a/gr-uhd/lib/uhd_single_usrp_sink.h
+++ b/gr-uhd/lib/uhd_single_usrp_sink.h
@@ -29,7 +29,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 uhd::io_type_t::tid_t &type,
+ size_t num_channels = 1
);
class uhd_single_usrp_sink : public gr_sync_block{
diff --git a/gr-uhd/lib/uhd_single_usrp_source.cc b/gr-uhd/lib/uhd_single_usrp_source.cc
index 13e4d6d43..5da4385b2 100644
--- a/gr-uhd/lib/uhd_single_usrp_source.cc
+++ b/gr-uhd/lib/uhd_single_usrp_source.cc
@@ -39,8 +39,9 @@ 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
- ) : uhd_single_usrp_source(gr_make_io_signature(1, 1, type.size)), _type(type)
+ const uhd::io_type_t &type,
+ size_t num_channels
+ ) : uhd_single_usrp_source(gr_make_io_signature(num_channels, num_channels, type.size)), _type(type)
{
_dev = uhd::usrp::single_usrp::make(args);
set_streaming(false);
@@ -157,9 +158,10 @@ private:
**********************************************************************/
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 uhd::io_type_t::tid_t &type,
+ size_t num_channels
){
return boost::shared_ptr<uhd_single_usrp_source>(
- new uhd_single_usrp_source_impl(args, type)
+ new uhd_single_usrp_source_impl(args, type, num_channels)
);
}
diff --git a/gr-uhd/lib/uhd_single_usrp_source.h b/gr-uhd/lib/uhd_single_usrp_source.h
index 5da7e2b9a..196b7c675 100644
--- a/gr-uhd/lib/uhd_single_usrp_source.h
+++ b/gr-uhd/lib/uhd_single_usrp_source.h
@@ -29,7 +29,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 uhd::io_type_t::tid_t &type,
+ size_t num_channels = 1
);
class uhd_single_usrp_source : public gr_sync_block{