summaryrefslogtreecommitdiff
path: root/gr-uhd/lib
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-02-04 13:51:02 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2015-02-04 13:51:02 -0800
commitbb2021f087700463151ad27427d17b7df8ff1294 (patch)
treedb1523157092921e95f35f4b2850bd3548faae71 /gr-uhd/lib
parent8de3c4ce4be79dd7dba4d7ec1371cd010328fec1 (diff)
parent42c1d6d339139eac1001bbc180907569da5e1702 (diff)
Merge branch 'master' into next
Diffstat (limited to 'gr-uhd/lib')
-rw-r--r--gr-uhd/lib/usrp_common.h15
-rw-r--r--gr-uhd/lib/usrp_sink_impl.cc12
-rw-r--r--gr-uhd/lib/usrp_sink_impl.h3
-rw-r--r--gr-uhd/lib/usrp_source_impl.cc13
-rw-r--r--gr-uhd/lib/usrp_source_impl.h1
5 files changed, 40 insertions, 4 deletions
diff --git a/gr-uhd/lib/usrp_common.h b/gr-uhd/lib/usrp_common.h
index 29caa585cf..41f443922c 100644
--- a/gr-uhd/lib/usrp_common.h
+++ b/gr-uhd/lib/usrp_common.h
@@ -180,9 +180,22 @@ namespace gr {
return true;
}
+ void _update_stream_args(const ::uhd::stream_args_t &stream_args_)
+ {
+ ::uhd::stream_args_t stream_args(stream_args_);
+ if (stream_args.channels.empty()) {
+ stream_args.channels = _stream_args.channels;
+ }
+ if (stream_args.cpu_format != _stream_args.cpu_format ||
+ stream_args.channels.size() != _stream_args.channels.size()) {
+ throw std::runtime_error("Cannot change I/O signatures while updating stream args!");
+ }
+ _stream_args = stream_args;
+ }
+
//! Shared pointer to the underlying multi_usrp object
::uhd::usrp::multi_usrp::sptr _dev;
- const ::uhd::stream_args_t _stream_args;
+ ::uhd::stream_args_t _stream_args;
boost::shared_ptr< ::uhd::io_type_t > _type;
//! Number of channels (i.e. number of in- or outputs)
size_t _nchan;
diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc
index e50aac933a..0b1ad6488c 100644
--- a/gr-uhd/lib/usrp_sink_impl.cc
+++ b/gr-uhd/lib/usrp_sink_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2013 Free Software Foundation, Inc.
+ * Copyright 2010-2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -546,6 +546,16 @@ namespace gr {
#endif
}
+ void
+ usrp_sink_impl::set_stream_args(const ::uhd::stream_args_t &stream_args)
+ {
+ _update_stream_args(stream_args);
+#ifdef GR_UHD_USE_STREAM_API
+ _tx_stream.reset();
+#else
+ throw std::runtime_error("not implemented in this version");
+#endif
+ }
/***********************************************************************
* Work
diff --git a/gr-uhd/lib/usrp_sink_impl.h b/gr-uhd/lib/usrp_sink_impl.h
index 0cc7f59af0..e0cb5a9a60 100644
--- a/gr-uhd/lib/usrp_sink_impl.h
+++ b/gr-uhd/lib/usrp_sink_impl.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2014 Free Software Foundation, Inc.
+ * Copyright 2010-2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -113,6 +113,7 @@ namespace gr {
void set_command_time(const ::uhd::time_spec_t &time_spec, size_t mboard);
void clear_command_time(size_t mboard);
void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard);
+ void set_stream_args(const ::uhd::stream_args_t &stream_args);
void set_start_time(const ::uhd::time_spec_t &time);
bool start(void);
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index b36e71befe..62ef2f56c7 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2013 Free Software Foundation, Inc.
+ * Copyright 2010-2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -522,6 +522,17 @@ namespace gr {
}
void
+ usrp_source_impl::set_stream_args(const ::uhd::stream_args_t &stream_args)
+ {
+ _update_stream_args(stream_args);
+#ifdef GR_UHD_USE_STREAM_API
+ _rx_stream.reset();
+#else
+ throw std::runtime_error("not implemented in this version");
+#endif
+ }
+
+ void
usrp_source_impl::set_start_time(const ::uhd::time_spec_t &time)
{
_start_time = time;
diff --git a/gr-uhd/lib/usrp_source_impl.h b/gr-uhd/lib/usrp_source_impl.h
index c4a96aab42..d5bd2f4149 100644
--- a/gr-uhd/lib/usrp_source_impl.h
+++ b/gr-uhd/lib/usrp_source_impl.h
@@ -113,6 +113,7 @@ namespace gr {
void set_time_unknown_pps(const ::uhd::time_spec_t &time_spec);
void set_command_time(const ::uhd::time_spec_t &time_spec, size_t mboard);
void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard);
+ void set_stream_args(const ::uhd::stream_args_t &stream_args);
void set_start_time(const ::uhd::time_spec_t &time);
void issue_stream_cmd(const ::uhd::stream_cmd_t &cmd);