summaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_timed_samples.cpp9
-rw-r--r--host/examples/test_async_messages.cpp8
-rw-r--r--host/examples/tx_waveforms.cpp2
3 files changed, 12 insertions, 7 deletions
diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp
index 9ebe36c5a..630b4a7a9 100644
--- a/host/examples/rx_timed_samples.cpp
+++ b/host/examples/rx_timed_samples.cpp
@@ -32,7 +32,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::string args;
double seconds_in_future;
size_t total_num_samps;
- double rate, freq;
+ double rate, freq, clock;
//setup the program options
po::options_description desc("Allowed options");
@@ -41,6 +41,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("secs", po::value<double>(&seconds_in_future)->default_value(3), "number of seconds in the future to receive")
("nsamps", po::value<size_t>(&total_num_samps)->default_value(1000), "total number of samples to receive")
+ ("clock", po::value<double>(&clock), "master clock frequency in Hz")
("rate", po::value<double>(&rate)->default_value(100e6/16), "rate of incoming samples")
("freq", po::value<double>(&freq)->default_value(0), "rf center frequency in Hz")
("dilv", "specify to disable inner-loop verbose")
@@ -63,6 +64,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);
std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl;
+ //optionally set the clock rate (do before setting anything else)
+ if (vm.count("clock")){
+ std::cout << boost::format("Setting master clock rate: %f MHz...") % (clock/1e6) << std::endl;
+ usrp->set_master_clock_rate(clock);
+ }
+
//set the rx sample rate
std::cout << boost::format("Setting RX Rate: %f Msps...") % (rate/1e6) << std::endl;
usrp->set_rx_rate(rate);
diff --git a/host/examples/test_async_messages.cpp b/host/examples/test_async_messages.cpp
index 7f1094ee0..7f922ed35 100644
--- a/host/examples/test_async_messages.cpp
+++ b/host/examples/test_async_messages.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -91,8 +91,7 @@ bool test_underflow_message(uhd::usrp::multi_usrp::sptr usrp){
md.end_of_burst = false;
md.has_time_spec = false;
- usrp->get_device()->send(
- NULL, 0, md,
+ usrp->get_device()->send("", 0, md,
uhd::io_type_t::COMPLEX_FLOAT32,
uhd::device::SEND_MODE_FULL_BUFF
);
@@ -139,8 +138,7 @@ bool test_time_error_message(uhd::usrp::multi_usrp::sptr usrp){
usrp->set_time_now(uhd::time_spec_t(200.0)); //time at 200s
- usrp->get_device()->send(
- NULL, 0, md,
+ usrp->get_device()->send("", 0, md,
uhd::io_type_t::COMPLEX_FLOAT32,
uhd::device::SEND_MODE_FULL_BUFF
);
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index dd18d3174..05d49a8b3 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -171,7 +171,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//send a mini EOB packet
md.start_of_burst = false;
md.end_of_burst = true;
- usrp->get_device()->send(NULL, 0, md,
+ usrp->get_device()->send("", 0, md,
uhd::io_type_t::COMPLEX_FLOAT32,
uhd::device::SEND_MODE_FULL_BUFF
);