aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-14 16:51:47 -0700
committerJosh Blum <josh@joshknows.com>2010-10-14 16:51:47 -0700
commit71e1763332141603e9edba097fd19b00e9a76ab8 (patch)
tree9d216251fc58d2e731bb79d26aefa29480c9b2ac /host
parent4582a2deb385c0a4849f5d20c44a5469779bcbb2 (diff)
downloaduhd-71e1763332141603e9edba097fd19b00e9a76ab8.tar.gz
uhd-71e1763332141603e9edba097fd19b00e9a76ab8.tar.bz2
uhd-71e1763332141603e9edba097fd19b00e9a76ab8.zip
uhd: removed 1 sample buffers in test async messages
made a hack in the vrt handler to bump 0 sample requests up to 1 sample (until the hardware supports it)
Diffstat (limited to 'host')
-rw-r--r--host/examples/test_async_messages.cpp8
-rw-r--r--host/lib/transport/vrt_packet_handler.hpp13
2 files changed, 13 insertions, 8 deletions
diff --git a/host/examples/test_async_messages.cpp b/host/examples/test_async_messages.cpp
index bdee7a504..61db7ec04 100644
--- a/host/examples/test_async_messages.cpp
+++ b/host/examples/test_async_messages.cpp
@@ -93,10 +93,8 @@ bool test_underflow_message(uhd::usrp::single_usrp::sptr sdev){
md.end_of_burst = false;
md.has_time_spec = false;
- std::vector<std::complex<float> > buff(1); //minimum 1 sample
-
dev->send(
- &buff.front(), buff.size(), md,
+ NULL, 0, md,
uhd::io_type_t::COMPLEX_FLOAT32,
uhd::device::SEND_MODE_FULL_BUFF
);
@@ -144,10 +142,8 @@ bool test_time_error_message(uhd::usrp::single_usrp::sptr sdev){
sdev->set_time_now(uhd::time_spec_t(200.0)); //time at 200s
- std::vector<std::complex<float> > buff(1); //minimum 1 sample
-
dev->send(
- &buff.front(), buff.size(), md,
+ NULL, 0, md,
uhd::io_type_t::COMPLEX_FLOAT32,
uhd::device::SEND_MODE_FULL_BUFF
);
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp
index d5f03de0e..278bcfeaa 100644
--- a/host/lib/transport/vrt_packet_handler.hpp
+++ b/host/lib/transport/vrt_packet_handler.hpp
@@ -388,10 +388,19 @@ template <typename T> UHD_INLINE T get_context_code(
if_packet_info.sob = metadata.start_of_burst;
if_packet_info.eob = metadata.end_of_burst;
+ //TODO remove this code when sample counts of zero are supported by hardware
+ std::vector<const void *> buffs_(buffs);
+ size_t total_num_samps_(total_num_samps);
+ if (total_num_samps == 0){
+ static const boost::uint64_t zeros = 0; //max size of a host sample
+ buffs_ = std::vector<const void *>(buffs.size(), &zeros);
+ total_num_samps_ = 1;
+ }
+
return _send1(
state,
- buffs, 0,
- std::min(total_num_samps, max_samples_per_packet),
+ buffs_, 0,
+ std::min(total_num_samps_, max_samples_per_packet),
if_packet_info,
io_type, otw_type,
vrt_packer,