aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-25 18:36:16 -0700
committerJosh Blum <josh@joshknows.com>2010-03-25 18:36:16 -0700
commitaf586ae149fe6f7aa12d4d6766e4216f3f00d1c0 (patch)
tree4edc587df783b521c0d900d8785ab05296c6efe3 /host/examples
parent7d195aa792037f0b5bce5085fb2db3512b479575 (diff)
downloaduhd-af586ae149fe6f7aa12d4d6766e4216f3f00d1c0.tar.gz
uhd-af586ae149fe6f7aa12d4d6766e4216f3f00d1c0.tar.bz2
uhd-af586ae149fe6f7aa12d4d6766e4216f3f00d1c0.zip
Overhaullllllled the way we do streaming. There is an odd bug where
a zero length command (now, no chain) used to stop the streaming. Now it seems to do the reverse... must investigate. Made all clock configuration into enums. The strings were painful and there cant be that many variations that enums cant cover them. The enums will make more sense to developers than mystery strings.
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_timed_samples.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp
index 97f75647e..7d58187cd 100644
--- a/host/examples/rx_timed_samples.cpp
+++ b/host/examples/rx_timed_samples.cpp
@@ -65,9 +65,14 @@ int main(int argc, char *argv[]){
//setup streaming
std::cout << std::endl;
- std::cout << boost::format("Begin streaming %u seconds in the future...")
- % seconds_in_future << std::endl;
- sdev->set_streaming_at(uhd::time_spec_t(seconds_in_future));
+ std::cout << boost::format("Begin streaming %u samples, %d seconds in the future...")
+ % total_num_samps % seconds_in_future << std::endl;
+ uhd::stream_cmd_t stream_cmd;
+ stream_cmd.stream_now = false;
+ stream_cmd.time_spec = uhd::time_spec_t(seconds_in_future);
+ stream_cmd.continuous = false;
+ stream_cmd.num_samps = total_num_samps;
+ sdev->issue_stream_cmd(stream_cmd);
//loop until total number of samples reached
size_t num_acc_samps = 0; //number of accumulated samples
@@ -83,8 +88,7 @@ int main(int argc, char *argv[]){
num_acc_samps += num_rx_samps;
}
- //finished, stop streaming
- sdev->set_streaming(false);
+ //finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
return 0;