From 82f0d5a6d23c6b561a17a8fa15187118b7f35f14 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 15 May 2017 13:55:39 -0700 Subject: examples: Added real streaming modes --- host/examples/rx_samples_to_file.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'host/examples') diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp index 934dce586..941e5eb65 100644 --- a/host/examples/rx_samples_to_file.cpp +++ b/host/examples/rx_samples_to_file.cpp @@ -231,7 +231,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("subdev", po::value(&subdev), "subdevice specification") ("bw", po::value(&bw), "analog frontend filter bandwidth in Hz") ("ref", po::value(&ref)->default_value("internal"), "reference source (internal, external, mimo)") - ("wirefmt", po::value(&wirefmt)->default_value("sc16"), "wire format (sc8 or sc16)") + ("wirefmt", po::value(&wirefmt)->default_value("sc16"), "wire format (sc8, sc16 or s16)") ("setup", po::value(&setup_time)->default_value(1.0), "seconds of setup time") ("progress", "periodically display short-term bandwidth") ("stats", "show average bandwidth on exit") @@ -331,10 +331,17 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ #define recv_to_file_args(format) \ (usrp, format, wirefmt, file, spb, total_num_samps, total_time, bw_summary, stats, null, enable_size_map, continue_on_bad_packet) //recv to file - if (type == "double") recv_to_file >recv_to_file_args("fc64"); - else if (type == "float") recv_to_file >recv_to_file_args("fc32"); - else if (type == "short") recv_to_file >recv_to_file_args("sc16"); - else throw std::runtime_error("Unknown type " + type); + if (wirefmt == "s16") { + if (type == "double") recv_to_filerecv_to_file_args("f64"); + else if (type == "float") recv_to_filerecv_to_file_args("f32"); + else if (type == "short") recv_to_filerecv_to_file_args("s16"); + else throw std::runtime_error("Unknown type " + type); + } else { + if (type == "double") recv_to_file >recv_to_file_args("fc64"); + else if (type == "float") recv_to_file >recv_to_file_args("fc32"); + else if (type == "short") recv_to_file >recv_to_file_args("sc16"); + else throw std::runtime_error("Unknown type " + type); + } //finished std::cout << std::endl << "Done!" << std::endl << std::endl; -- cgit v1.2.3