aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_ascii_art_dft.cpp7
-rw-r--r--host/examples/rx_samples_to_file.cpp8
-rw-r--r--host/examples/rx_samples_to_udp.cpp8
-rw-r--r--host/examples/tx_bursts.cpp9
-rw-r--r--host/examples/tx_samples_from_file.cpp8
-rw-r--r--host/examples/tx_timed_samples.cpp2
-rw-r--r--host/examples/tx_waveforms.cpp7
-rw-r--r--host/examples/txrx_loopback_to_file.cpp13
8 files changed, 46 insertions, 16 deletions
diff --git a/host/examples/rx_ascii_art_dft.cpp b/host/examples/rx_ascii_art_dft.cpp
index df3256b09..ab835a07d 100644
--- a/host/examples/rx_ascii_art_dft.cpp
+++ b/host/examples/rx_ascii_art_dft.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2014 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
@@ -56,6 +56,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("ref-lvl", po::value<float>(&ref_lvl)->default_value(0), "reference level for the display (dB)")
("dyn-rng", po::value<float>(&dyn_rng)->default_value(60), "dynamic range for the display (dB)")
("ref", po::value<std::string>(&ref)->default_value("internal"), "waveform type (internal, external, mimo)")
+ ("int-n", "tune USRP with integer-N tuning")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -95,7 +96,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
return EXIT_FAILURE;
}
std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq/1e6) << std::endl;
- usrp->set_rx_freq(freq);
+ uhd::tune_request_t tune_request(freq);
+ if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ usrp->set_rx_freq(tune_request);
std::cout << boost::format("Actual RX Freq: %f MHz...") % (usrp->get_rx_freq()/1e6) << std::endl << std::endl;
//set the rf gain
diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp
index a28d1d628..75afddbd9 100644
--- a/host/examples/rx_samples_to_file.cpp
+++ b/host/examples/rx_samples_to_file.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2014 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
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+#include <uhd/types/tune_request.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
@@ -242,6 +243,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("null", "run without writing to file")
("continue", "don't abort on a bad packet")
("skip-lo", "skip checking LO lock status")
+ ("int-n", "tune USRP with integer-N tuning")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -287,7 +289,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//set the center frequency
if (vm.count("freq")){ //with default of 0.0 this will always be true
std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq/1e6) << std::endl;
- usrp->set_rx_freq(freq);
+ uhd::tune_request_t tune_request(freq);
+ if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ usrp->set_rx_freq(tune_request);
std::cout << boost::format("Actual RX Freq: %f MHz...") % (usrp->get_rx_freq()/1e6) << std::endl << std::endl;
}
diff --git a/host/examples/rx_samples_to_udp.cpp b/host/examples/rx_samples_to_udp.cpp
index 0b3c6dce3..72fb54bd3 100644
--- a/host/examples/rx_samples_to_udp.cpp
+++ b/host/examples/rx_samples_to_udp.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2012,2014 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
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+#include <uhd/types/tune_request.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
@@ -52,6 +53,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("port", po::value<std::string>(&port)->default_value("7124"), "server udp port")
("addr", po::value<std::string>(&addr)->default_value("192.168.1.10"), "resolvable server address")
("ref", po::value<std::string>(&ref)->default_value("internal"), "waveform type (internal, external, mimo)")
+ ("int-n", "tune USRP with integer-N tuning")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -79,7 +81,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//set the rx center frequency
std::cout << boost::format("Setting RX Freq: %f Mhz...") % (freq/1e6) << std::endl;
- usrp->set_rx_freq(freq);
+ uhd::tune_request_t tune_request(freq);
+ if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ usrp->set_rx_freq(tune_request);
std::cout << boost::format("Actual RX Freq: %f Mhz...") % (usrp->get_rx_freq()/1e6) << std::endl << std::endl;
//set the rx rf gain
diff --git a/host/examples/tx_bursts.cpp b/host/examples/tx_bursts.cpp
index eada1a618..333e15939 100644
--- a/host/examples/tx_bursts.cpp
+++ b/host/examples/tx_bursts.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2014 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
@@ -60,6 +60,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("gain", po::value<double>(&gain)->default_value(0), "gain")
("dilv", "specify to disable inner-loop verbose")
("channels", po::value<std::string>(&channel_list)->default_value("0"), "which channel(s) to use (specify \"0\", \"1\", \"0,1\", etc")
+ ("int-n", "tune USRP with integer-n tuning")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -98,7 +99,11 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << boost::format("Actual TX Rate: %f Msps...") % (usrp->get_tx_rate()/1e6) << std::endl << std::endl;
std::cout << boost::format("Setting TX Freq: %f MHz...") % (freq/1e6) << std::endl;
- for(size_t i=0; i < channel_nums.size(); i++) usrp->set_tx_freq(freq, channel_nums[i]);
+ for(size_t i=0; i < channel_nums.size(); i++){
+ uhd::tune_request_t tune_request(freq);
+ if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ usrp->set_tx_freq(tune_request, channel_nums[i]);
+ }
std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq()/1e6) << std::endl << std::endl;
std::cout << boost::format("Setting TX Gain: %f...") % (gain) << std::endl;
diff --git a/host/examples/tx_samples_from_file.cpp b/host/examples/tx_samples_from_file.cpp
index f9447c25d..6926f8690 100644
--- a/host/examples/tx_samples_from_file.cpp
+++ b/host/examples/tx_samples_from_file.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011-2012 Ettus Research LLC
+// Copyright 2011-2012,2014 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
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+#include <uhd/types/tune_request.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
@@ -90,6 +91,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("wirefmt", po::value<std::string>(&wirefmt)->default_value("sc16"), "wire format (sc8 or sc16)")
("delay", po::value<double>(&delay)->default_value(0.0), "specify a delay between repeated transmission of file")
("repeat", "repeatedly transmit file")
+ ("int-n", "tune USRP with integer-n tuning")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -131,7 +133,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
return ~0;
}
std::cout << boost::format("Setting TX Freq: %f MHz...") % (freq/1e6) << std::endl;
- usrp->set_tx_freq(freq);
+ uhd::tune_request_t tune_request(freq);
+ if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ usrp->set_tx_freq(tune_request);
std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq()/1e6) << std::endl << std::endl;
//set the rf gain
diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp
index 2eef80389..8826deadd 100644
--- a/host/examples/tx_timed_samples.cpp
+++ b/host/examples/tx_timed_samples.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2014 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
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index 9474642df..11eec20a3 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2012,2014 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
@@ -116,6 +116,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("ref", po::value<std::string>(&ref)->default_value("internal"), "clock reference (internal, external, mimo)")
("otw", po::value<std::string>(&otw)->default_value("sc16"), "specify the over-the-wire sample mode")
("channels", po::value<std::string>(&channel_list)->default_value("0"), "which channels to use (specify \"0\", \"1\", \"0,1\", etc)")
+ ("int-n", "tune USRP with integer-N tuning")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -170,7 +171,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
for(size_t ch = 0; ch < channel_nums.size(); ch++) {
std::cout << boost::format("Setting TX Freq: %f MHz...") % (freq/1e6) << std::endl;
- usrp->set_tx_freq(freq, channel_nums[ch]);
+ uhd::tune_request_t tune_request(freq);
+ if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ usrp->set_tx_freq(tune_request, channel_nums[ch]);
std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq(channel_nums[ch])/1e6) << std::endl << std::endl;
//set the rf gain
diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp
index 666153edb..18c564097 100644
--- a/host/examples/txrx_loopback_to_file.cpp
+++ b/host/examples/txrx_loopback_to_file.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2012,2014 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
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+#include <uhd/types/tune_request.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/utils/static.hpp>
@@ -240,6 +241,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("otw", po::value<std::string>(&otw)->default_value("sc16"), "specify the over-the-wire sample mode")
("tx-channels", po::value<std::string>(&tx_channels)->default_value("0"), "which TX channel(s) to use (specify \"0\", \"1\", \"0,1\", etc)")
("rx-channels", po::value<std::string>(&rx_channels)->default_value("0"), "which RX channel(s) to use (specify \"0\", \"1\", \"0,1\", etc)")
+ ("tx-int-n", "tune USRP TX with integer-N tuning")
+ ("rx-int-n", "tune USRP RX with integer-N tuning")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
@@ -318,7 +321,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
for(size_t ch = 0; ch < tx_channel_nums.size(); ch++) {
std::cout << boost::format("Setting TX Freq: %f MHz...") % (tx_freq/1e6) << std::endl;
- tx_usrp->set_tx_freq(tx_freq, tx_channel_nums[ch]);
+ uhd::tune_request_t tx_tune_request(tx_freq);
+ if(vm.count("tx-int-n")) tx_tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ tx_usrp->set_tx_freq(tx_tune_request, tx_channel_nums[ch]);
std::cout << boost::format("Actual TX Freq: %f MHz...") % (tx_usrp->get_tx_freq(tx_channel_nums[ch])/1e6) << std::endl << std::endl;
//set the rf gain
@@ -345,7 +350,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
return ~0;
}
std::cout << boost::format("Setting RX Freq: %f MHz...") % (rx_freq/1e6) << std::endl;
- rx_usrp->set_rx_freq(rx_freq);
+ uhd::tune_request_t rx_tune_request(rx_freq);
+ if(vm.count("rx-int-n")) rx_tune_request.args = uhd::device_addr_t("mode_n=int-n");
+ rx_usrp->set_rx_freq(rx_tune_request);
std::cout << boost::format("Actual RX Freq: %f MHz...") % (rx_usrp->get_rx_freq()/1e6) << std::endl << std::endl;
//set the receive rf gain