aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/vrt_packet_handler.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-11 12:19:03 -0800
committerJosh Blum <josh@joshknows.com>2010-11-11 12:19:03 -0800
commite0d84e8c8b4f0bb9fec22b48b7c61b9ca3eb8dbd (patch)
tree40276e2499f25816ba14456b8439b7caf9783c0d /host/lib/transport/vrt_packet_handler.hpp
parentb7b3e8288dcd64e47c242edbc5b009b9300615a2 (diff)
downloaduhd-e0d84e8c8b4f0bb9fec22b48b7c61b9ca3eb8dbd.tar.gz
uhd-e0d84e8c8b4f0bb9fec22b48b7c61b9ca3eb8dbd.tar.bz2
uhd-e0d84e8c8b4f0bb9fec22b48b7c61b9ca3eb8dbd.zip
uhd: pulled in some worthwhile changes from flow control branch
Diffstat (limited to 'host/lib/transport/vrt_packet_handler.hpp')
-rw-r--r--host/lib/transport/vrt_packet_handler.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp
index 939517411..278bcfeaa 100644
--- a/host/lib/transport/vrt_packet_handler.hpp
+++ b/host/lib/transport/vrt_packet_handler.hpp
@@ -318,7 +318,7 @@ template <typename T> UHD_INLINE T get_context_code(
){
//load the rest of the if_packet_info in here
if_packet_info.num_payload_words32 = (num_samps*chans_per_otw_buff*otw_type.get_sample_size())/sizeof(boost::uint32_t);
- if_packet_info.packet_count = state.next_packet_seq++;
+ if_packet_info.packet_count = state.next_packet_seq;
//get send buffers for each channel
managed_send_buffs_t send_buffs(buffs.size()/chans_per_otw_buff);
@@ -345,6 +345,7 @@ template <typename T> UHD_INLINE T get_context_code(
size_t num_bytes_total = (vrt_header_offset_words32+if_packet_info.num_packet_words32)*sizeof(boost::uint32_t);
send_buffs[i]->commit(num_bytes_total);
}
+ state.next_packet_seq++; //increment sequence after commits
return num_samps;
}
@@ -387,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,