From 59433663b1de1fb142d77da52aab99763577f79a Mon Sep 17 00:00:00 2001 From: Marcus Müller Date: Wed, 2 Mar 2016 20:12:06 +0100 Subject: e300: Fixed a memory leak in udev code When querying temp mboard sensor on e300, sysfs attributes are read through udev. --- host/lib/usrp/e300/e300_sysfs_hooks.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/host/lib/usrp/e300/e300_sysfs_hooks.cpp b/host/lib/usrp/e300/e300_sysfs_hooks.cpp index ee2ac21d7..7bd1d6d7e 100644 --- a/host/lib/usrp/e300/e300_sysfs_hooks.cpp +++ b/host/lib/usrp/e300/e300_sysfs_hooks.cpp @@ -65,10 +65,11 @@ std::string e300_get_sysfs_attr(const std::string &node, const std::string &attr dev = udev_device_new_from_syspath(udev, path); retstring = udev_device_get_sysattr_value(dev, attr.c_str()); - if (retstring.size()) - break; udev_device_unref(dev); + + if (retstring.size()) + break; } udev_enumerate_unref(enumerate); -- cgit v1.2.3 From 1e803ff6ac2ac86acaeb4d4b560846b0aa85fce2 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 3 Mar 2016 11:54:06 -0800 Subject: x300: Added power cycle message to uhd_image_loader --- host/lib/usrp/x300/x300_image_loader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/host/lib/usrp/x300/x300_image_loader.cpp b/host/lib/usrp/x300/x300_image_loader.cpp index 9ec8a2e13..e8a1b5269 100644 --- a/host/lib/usrp/x300/x300_image_loader.cpp +++ b/host/lib/usrp/x300/x300_image_loader.cpp @@ -365,6 +365,7 @@ static void x300_ethernet_load(x300_session_t &session){ } else std::cout << "successful." << std::endl; } + std::cout << str(boost::format("Power-cycle the USRP %s to use the new image.") % session.dev_addr.get("product", "")) << std::endl; } static void x300_pcie_load(x300_session_t &session){ @@ -382,6 +383,7 @@ static void x300_pcie_load(x300_session_t &session){ niusrprio::nirio_status_to_exception(status, "NI-RIO reported the following error:"); } else std::cout << "successful." << std::endl; + std::cout << str(boost::format("Power-cycle the USRP %s to use the new image.") % session.dev_addr.get("product", "")) << std::endl; } static bool x300_image_loader(const image_loader::image_loader_args_t &image_loader_args){ -- cgit v1.2.3 From a9de87e33dc75bea0c7f3e814fbb1616029ac8c8 Mon Sep 17 00:00:00 2001 From: DaulPavid Date: Thu, 3 Mar 2016 12:37:18 -0800 Subject: examples: TX/RX loopback could run forever if the exact number of samples isn't received --- host/examples/txrx_loopback_to_file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index 7dc3bd9c2..0ce7ac52a 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -149,7 +149,7 @@ template void recv_to_file( stream_cmd.time_spec = uhd::time_spec_t(settling_time); rx_stream->issue_stream_cmd(stream_cmd); - while(not stop_signal_called and (num_requested_samples != num_total_samps or num_requested_samples == 0)){ + while(not stop_signal_called and (num_requested_samples < num_total_samps or num_requested_samples == 0)){ size_t num_rx_samps = rx_stream->recv(buff_ptrs, samps_per_buff, md, timeout); timeout = 0.1f; //small timeout for subsequent recv -- cgit v1.2.3 From 7b268bdb82959dd1df3657697dc26594b1ffd2d6 Mon Sep 17 00:00:00 2001 From: Paul David Date: Thu, 3 Mar 2016 16:10:17 -0800 Subject: examples: TX/RX loopback stopping condition was reversed No data was getting stored. --- host/examples/txrx_loopback_to_file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index 0ce7ac52a..eb2cd72a3 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -149,7 +149,7 @@ template void recv_to_file( stream_cmd.time_spec = uhd::time_spec_t(settling_time); rx_stream->issue_stream_cmd(stream_cmd); - while(not stop_signal_called and (num_requested_samples < num_total_samps or num_requested_samples == 0)){ + while(not stop_signal_called and (num_requested_samples > num_total_samps or num_requested_samples == 0)){ size_t num_rx_samps = rx_stream->recv(buff_ptrs, samps_per_buff, md, timeout); timeout = 0.1f; //small timeout for subsequent recv -- cgit v1.2.3 From e4792b00c88103bba9239bb5cabb10b95c4ae531 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Fri, 4 Mar 2016 10:32:32 -0800 Subject: Fixed minor warnings: * nirio_driver_iface_win: labeled unused variable for MinGW builds * b200_impl: fixed unreferenced variable warning * n200_image_loader: fixed signed vs. unsigned comparison --- host/lib/transport/nirio/nirio_driver_iface_win.cpp | 4 ++-- host/lib/usrp/b200/b200_impl.cpp | 2 +- host/lib/usrp/usrp2/n200_image_loader.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/host/lib/transport/nirio/nirio_driver_iface_win.cpp b/host/lib/transport/nirio/nirio_driver_iface_win.cpp index 717923176..c8484e953 100644 --- a/host/lib/transport/nirio/nirio_driver_iface_win.cpp +++ b/host/lib/transport/nirio/nirio_driver_iface_win.cpp @@ -1,5 +1,5 @@ // -// Copyright 2013,2015 Ettus Research LLC +// Copyright 2013,2015-2016 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 @@ -66,7 +66,7 @@ nirio_status rio_ioctl( read_buf, static_cast(read_buf_len), &outLen, &zeroedOverlapped ))) { - int_fast32_t lastError = GetLastError(); + UHD_UNUSED(int_fast32_t lastError) = GetLastError(); return NiRio_Status_SoftwareFault; } diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 200d99aee..18dcdadba 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -348,7 +348,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s handle = dev_handle; break; } - } catch (const uhd::exception &e) { continue; } + } catch (const uhd::exception&) { continue; } } UHD_ASSERT_THROW(handle.get() != NULL); //better be found diff --git a/host/lib/usrp/usrp2/n200_image_loader.cpp b/host/lib/usrp/usrp2/n200_image_loader.cpp index 29bec8b4a..d6acfe39d 100644 --- a/host/lib/usrp/usrp2/n200_image_loader.cpp +++ b/host/lib/usrp/usrp2/n200_image_loader.cpp @@ -1,5 +1,5 @@ // -// Copyright 2015 Ettus Research LLC +// Copyright 2015-2016 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 @@ -201,7 +201,7 @@ static UHD_INLINE bool n200_response_matches(const n200_fw_update_data_t *pkt_in n200_fw_update_id_t pkt_code, size_t len){ return (len > offsetof(n200_fw_update_data_t, data) and - ntohl(pkt_in->id) == pkt_code); + ntohl(pkt_in->id) == (unsigned)pkt_code); } static uhd::device_addr_t n200_find(const image_loader::image_loader_args_t &image_loader_args){ -- cgit v1.2.3 From ccc8acb743aaab6cd3e926d5901fa3fa4114a469 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 8 Mar 2016 11:22:36 -0800 Subject: Added includes to support more platforms --- host/include/uhd/deprecated.hpp | 1 + host/include/uhd/types/ref_vector.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/host/include/uhd/deprecated.hpp b/host/include/uhd/deprecated.hpp index 95cce58e9..ab24600bf 100644 --- a/host/include/uhd/deprecated.hpp +++ b/host/include/uhd/deprecated.hpp @@ -23,6 +23,7 @@ #define INCLUDED_UHD_TYPES_OTW_TYPE_HPP #include +#include namespace uhd{ diff --git a/host/include/uhd/types/ref_vector.hpp b/host/include/uhd/types/ref_vector.hpp index bbfb5434d..61a82cee8 100644 --- a/host/include/uhd/types/ref_vector.hpp +++ b/host/include/uhd/types/ref_vector.hpp @@ -19,6 +19,7 @@ #define INCLUDED_UHD_TYPES_REF_VECTOR_HPP #include +#include namespace uhd{ -- cgit v1.2.3