aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/test_timed_commands.cpp
diff options
context:
space:
mode:
authorMichael West <michael.west@ettus.com>2014-01-09 17:02:32 -0800
committerMichael West <michael.west@ettus.com>2014-01-09 17:02:32 -0800
commit61c5ddbe9cc391da5e70bd90bae8b9b2dcab280a (patch)
tree3ed334fc7ce6ff1e65667005d7d2009e6a52a254 /host/examples/test_timed_commands.cpp
parent6f26689e35fa17d1befc9124bf12e93aee774670 (diff)
downloaduhd-61c5ddbe9cc391da5e70bd90bae8b9b2dcab280a.tar.gz
uhd-61c5ddbe9cc391da5e70bd90bae8b9b2dcab280a.tar.bz2
uhd-61c5ddbe9cc391da5e70bd90bae8b9b2dcab280a.zip
BUG 298: B200: timed receive does not work on B210
BUG 299: UHD: test_timed_commands divides difference by 100 Changed stream_now to false, added assignment of time_spec to command, and fixed typo.
Diffstat (limited to 'host/examples/test_timed_commands.cpp')
-rw-r--r--host/examples/test_timed_commands.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/host/examples/test_timed_commands.cpp b/host/examples/test_timed_commands.cpp
index 224961d04..10336ec34 100644
--- a/host/examples/test_timed_commands.cpp
+++ b/host/examples/test_timed_commands.cpp
@@ -87,16 +87,17 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//setup streaming
std::cout << std::endl;
std::cout << "About to start streaming using timed command:" << std::endl;
-
+
//create a receive streamer
uhd::stream_args_t stream_args("fc32"); //complex floats
uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);
-
+
uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);
stream_cmd.num_samps = 100;
- stream_cmd.stream_now = true;
+ stream_cmd.stream_now = false;
const uhd::time_spec_t stream_time = usrp->get_time_now() + uhd::time_spec_t(0.1);
usrp->set_command_time(stream_time);
+ stream_cmd.time_spec = stream_time;
rx_stream->issue_stream_cmd(stream_cmd);
usrp->clear_command_time();
@@ -120,7 +121,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
) % stream_time.get_full_secs() % stream_time.get_frac_secs() << std::endl;
std::cout << boost::format(
"Difference between stream time and first packet: %f us"
- ) % ((md.time_spec-stream_time).get_real_secs()/100*1e6) << std::endl;
+ ) % ((md.time_spec-stream_time).get_real_secs()*1e6) << std::endl;
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;