aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-09-24 15:53:03 -0700
committerJosh Blum <josh@joshknows.com>2010-09-24 15:53:03 -0700
commit192663bcc919a794a24eabb38d12519f445b7a47 (patch)
treeba55269010c4484bef12d4019c691d9e469165d7 /host/examples
parent77cdb4a9695e71e64e1d87cfad2cb4d8717f971e (diff)
parent5d6d25b49cc783ef012410064bc9eb0e66e50227 (diff)
downloaduhd-192663bcc919a794a24eabb38d12519f445b7a47.tar.gz
uhd-192663bcc919a794a24eabb38d12519f445b7a47.tar.bz2
uhd-192663bcc919a794a24eabb38d12519f445b7a47.zip
Merge branch 'master' into usrp_e
Conflicts: host/CMakeLists.txt
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/benchmark_rx_rate.cpp8
-rw-r--r--host/examples/rx_timed_samples.cpp6
-rw-r--r--host/examples/test_async_messages.cpp12
-rw-r--r--host/examples/test_pps_input.cpp16
-rw-r--r--host/examples/tx_timed_samples.cpp6
-rw-r--r--host/examples/tx_waveforms.cpp6
6 files changed, 27 insertions, 27 deletions
diff --git a/host/examples/benchmark_rx_rate.cpp b/host/examples/benchmark_rx_rate.cpp
index 8fae813cf..36611f97f 100644
--- a/host/examples/benchmark_rx_rate.cpp
+++ b/host/examples/benchmark_rx_rate.cpp
@@ -17,7 +17,7 @@
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
-#include <uhd/usrp/simple_usrp.hpp>
+#include <uhd/usrp/single_usrp.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
@@ -27,7 +27,7 @@
namespace po = boost::program_options;
static inline void test_device(
- uhd::usrp::simple_usrp::sptr sdev,
+ uhd::usrp::single_usrp::sptr sdev,
double rx_rate_sps,
double duration_secs
){
@@ -118,7 +118,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
po::options_description desc("Allowed options");
desc.add_options()
("help", "help message")
- ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args")
+ ("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("duration", po::value<double>(&duration)->default_value(10.0), "duration for each test in seconds")
("rate", po::value<double>(&only_rate), "specify to perform a single test as this rate (sps)")
;
@@ -135,7 +135,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//create a usrp device
std::cout << std::endl;
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
+ uhd::usrp::single_usrp::sptr sdev = uhd::usrp::single_usrp::make(args);
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;
sdev->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); //stop if left running
diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp
index 4856f6779..441665900 100644
--- a/host/examples/rx_timed_samples.cpp
+++ b/host/examples/rx_timed_samples.cpp
@@ -17,7 +17,7 @@
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
-#include <uhd/usrp/simple_usrp.hpp>
+#include <uhd/usrp/single_usrp.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <iostream>
@@ -38,7 +38,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
po::options_description desc("Allowed options");
desc.add_options()
("help", "help message")
- ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args")
+ ("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("secs", po::value<time_t>(&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")
("rxrate", po::value<double>(&rx_rate)->default_value(100e6/16), "rate of incoming samples")
@@ -60,7 +60,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//create a usrp device
std::cout << std::endl;
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
+ uhd::usrp::single_usrp::sptr sdev = uhd::usrp::single_usrp::make(args);
uhd::device::sptr dev = sdev->get_device();
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;
diff --git a/host/examples/test_async_messages.cpp b/host/examples/test_async_messages.cpp
index e02bc5f40..4c9d18121 100644
--- a/host/examples/test_async_messages.cpp
+++ b/host/examples/test_async_messages.cpp
@@ -18,7 +18,7 @@
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/utils/static.hpp>
-#include <uhd/usrp/simple_usrp.hpp>
+#include <uhd/usrp/single_usrp.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <complex>
@@ -33,7 +33,7 @@ static const size_t async_to_ms = 100;
* Send a burst of many samples that will fragment internally.
* We expect to not get any async messages.
*/
-void test_no_async_message(uhd::usrp::simple_usrp::sptr sdev){
+void test_no_async_message(uhd::usrp::single_usrp::sptr sdev){
uhd::device::sptr dev = sdev->get_device();
std::cout << "Test no async message... " << std::flush;
@@ -73,7 +73,7 @@ void test_no_async_message(uhd::usrp::simple_usrp::sptr sdev){
* Send a start of burst packet with no following end of burst.
* We expect to get an underflow(within a burst) async message.
*/
-void test_underflow_message(uhd::usrp::simple_usrp::sptr sdev){
+void test_underflow_message(uhd::usrp::single_usrp::sptr sdev){
uhd::device::sptr dev = sdev->get_device();
std::cout << "Test underflow message... " << std::flush;
@@ -117,7 +117,7 @@ void test_underflow_message(uhd::usrp::simple_usrp::sptr sdev){
* Send a burst packet that occurs at a time in the past.
* We expect to get a time error async message.
*/
-void test_time_error_message(uhd::usrp::simple_usrp::sptr sdev){
+void test_time_error_message(uhd::usrp::single_usrp::sptr sdev){
uhd::device::sptr dev = sdev->get_device();
std::cout << "Test time error message... " << std::flush;
@@ -170,7 +170,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
po::options_description desc("Allowed options");
desc.add_options()
("help", "help message")
- ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args")
+ ("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("rate", po::value<double>(&rate)->default_value(1.5e6), "rate of outgoing samples")
;
po::variables_map vm;
@@ -186,7 +186,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//create a usrp device
std::cout << std::endl;
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
+ uhd::usrp::single_usrp::sptr sdev = uhd::usrp::single_usrp::make(args);
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;
//set the tx sample rate
diff --git a/host/examples/test_pps_input.cpp b/host/examples/test_pps_input.cpp
index e01d32910..4b2bb62a3 100644
--- a/host/examples/test_pps_input.cpp
+++ b/host/examples/test_pps_input.cpp
@@ -17,7 +17,7 @@
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
-#include <uhd/usrp/simple_usrp.hpp>
+#include <uhd/usrp/single_usrp.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <boost/thread.hpp>
@@ -31,13 +31,13 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//variables to be set by po
std::string args;
- float seconds;
+ double seconds;
//setup the program options
po::options_description desc("Allowed options");
desc.add_options()
("help", "help message")
- ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args")
+ ("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -52,7 +52,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//create a usrp device
std::cout << std::endl;
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
+ uhd::usrp::single_usrp::sptr sdev = uhd::usrp::single_usrp::make(args);
uhd::device::sptr dev = sdev->get_device();
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;
@@ -60,20 +60,20 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << "Set time to known value (100.0) without regard to pps:" << std::endl;
sdev->set_time_now(uhd::time_spec_t(100.0));
boost::this_thread::sleep(boost::posix_time::seconds(1));
- std::cout << boost::format("Reading time 1 second later: %f\n") % (sdev->get_time_now().get_full_secs()) << std::endl;
+ std::cout << boost::format("Reading time 1 second later: %f\n") % (sdev->get_time_now().get_real_secs()) << std::endl;
//store the time to see if PPS resets it
- seconds = sdev->get_time_now().get_full_secs();
+ seconds = sdev->get_time_now().get_real_secs();
//set a known time at next PPS, check that time increments
uhd::time_spec_t time_spec = uhd::time_spec_t(0.0);
std::cout << "Set time to known value (0.0) at next pps:" << std::endl;
sdev->set_time_next_pps(time_spec);
boost::this_thread::sleep(boost::posix_time::seconds(1));
- std::cout << boost::format("Reading time 1 second later: %f\n") % (sdev->get_time_now().get_full_secs()) << std::endl;
+ std::cout << boost::format("Reading time 1 second later: %f\n") % (sdev->get_time_now().get_real_secs()) << std::endl;
//finished
- if (seconds > sdev->get_time_now().get_full_secs()){
+ if (seconds > sdev->get_time_now().get_real_secs()){
std::cout << std::endl << "Success!" << std::endl << std::endl;
return 0;
} else {
diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp
index 5b72bd72f..f34c121d5 100644
--- a/host/examples/tx_timed_samples.cpp
+++ b/host/examples/tx_timed_samples.cpp
@@ -17,7 +17,7 @@
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
-#include <uhd/usrp/simple_usrp.hpp>
+#include <uhd/usrp/single_usrp.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <iostream>
@@ -40,7 +40,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
po::options_description desc("Allowed options");
desc.add_options()
("help", "help message")
- ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args")
+ ("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("secs", po::value<time_t>(&seconds_in_future)->default_value(3), "number of seconds in the future to transmit")
("nsamps", po::value<size_t>(&total_num_samps)->default_value(1000), "total number of samples to transmit")
("spp", po::value<size_t>(&samps_per_packet)->default_value(1000), "number of samples per packet")
@@ -64,7 +64,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//create a usrp device
std::cout << std::endl;
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
+ uhd::usrp::single_usrp::sptr sdev = uhd::usrp::single_usrp::make(args);
uhd::device::sptr dev = sdev->get_device();
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index 3f319cf68..50982cf88 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -18,7 +18,7 @@
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/utils/static.hpp>
-#include <uhd/usrp/simple_usrp.hpp>
+#include <uhd/usrp/single_usrp.hpp>
#include <boost/program_options.hpp>
#include <boost/thread/thread_time.hpp> //system time
#include <boost/math/special_functions/round.hpp>
@@ -70,7 +70,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
po::options_description desc("Allowed options");
desc.add_options()
("help", "help message")
- ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args")
+ ("args", po::value<std::string>(&args)->default_value(""), "single uhd device address args")
("duration", po::value<size_t>(&total_duration)->default_value(3), "number of seconds to transmit")
("spb", po::value<size_t>(&spb)->default_value(10000), "samples per buffer")
("rate", po::value<double>(&rate)->default_value(1.5e6), "rate of outgoing samples")
@@ -93,7 +93,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//create a usrp device
std::cout << std::endl;
std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
+ uhd::usrp::single_usrp::sptr sdev = uhd::usrp::single_usrp::make(args);
uhd::device::sptr dev = sdev->get_device();
std::cout << boost::format("Using Device: %s") % sdev->get_pp_string() << std::endl;