diff options
author | Josh Blum <josh@joshknows.com> | 2011-05-11 10:38:28 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-05-11 10:38:28 -0700 |
commit | 328599eec46fde6f16e8cdcfe3e8f096d9466b90 (patch) | |
tree | 221214f8c28beaa0f5de542a0ff07637cd7fdb5d /host/lib/transport | |
parent | 4e0b42afcbbf1067cef2ad530f3b162e5a35771b (diff) | |
parent | c9bf4798cc19e9ac9bf2fbcfeeae7ed26936b19d (diff) | |
download | uhd-328599eec46fde6f16e8cdcfe3e8f096d9466b90.tar.gz uhd-328599eec46fde6f16e8cdcfe3e8f096d9466b90.tar.bz2 uhd-328599eec46fde6f16e8cdcfe3e8f096d9466b90.zip |
Merge branch 'master' into next
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/libusb1_zero_copy.cpp | 4 | ||||
-rw-r--r-- | host/lib/transport/udp_simple.cpp | 4 | ||||
-rw-r--r-- | host/lib/transport/udp_zero_copy.cpp | 17 |
3 files changed, 12 insertions, 13 deletions
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index ec2077d30..d4cfab422 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -20,13 +20,13 @@ #include <uhd/transport/bounded_buffer.hpp> #include <uhd/transport/buffer_pool.hpp> #include <uhd/utils/thread_priority.hpp> +#include <uhd/utils/log.hpp> #include <uhd/exception.hpp> #include <boost/function.hpp> #include <boost/foreach.hpp> #include <boost/thread/thread.hpp> #include <boost/thread/barrier.hpp> #include <list> -#include <iostream> using namespace uhd; using namespace uhd::transport; @@ -52,7 +52,7 @@ static void LIBUSB_CALL libusb_async_cb(libusb_transfer *lut){ //! callback to free transfer upon cancellation static void LIBUSB_CALL cancel_transfer_cb(libusb_transfer *lut){ if (lut->status == LIBUSB_TRANSFER_CANCELLED) libusb_free_transfer(lut); - else std::cout << "libusb cancel_transfer unexpected status " << lut->status << std::endl; + else UHD_LOGV(rarely) << "libusb cancel_transfer unexpected status " << lut->status << std::endl; } /*********************************************************************** diff --git a/host/lib/transport/udp_simple.cpp b/host/lib/transport/udp_simple.cpp index 1ee036d52..ed778fbf4 100644 --- a/host/lib/transport/udp_simple.cpp +++ b/host/lib/transport/udp_simple.cpp @@ -17,8 +17,8 @@ #include "udp_common.hpp" #include <uhd/transport/udp_simple.hpp> +#include <uhd/utils/log.hpp> #include <boost/format.hpp> -#include <iostream> using namespace uhd::transport; namespace asio = boost::asio; @@ -31,7 +31,7 @@ public: udp_simple_impl( const std::string &addr, const std::string &port, bool bcast, bool connect ):_connected(connect){ - //std::cout << boost::format("Creating udp transport for %s %s") % addr % port << std::endl; + UHD_LOG << boost::format("Creating udp transport for %s %s") % addr % port << std::endl; //resolve the address asio::ip::udp::resolver resolver(_io_service); diff --git a/host/lib/transport/udp_zero_copy.cpp b/host/lib/transport/udp_zero_copy.cpp index 5810f441c..c3ba085bf 100644 --- a/host/lib/transport/udp_zero_copy.cpp +++ b/host/lib/transport/udp_zero_copy.cpp @@ -20,9 +20,9 @@ #include <uhd/transport/udp_simple.hpp> //mtu #include <uhd/transport/bounded_buffer.hpp> #include <uhd/transport/buffer_pool.hpp> -#include <uhd/utils/warning.hpp> +#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp> #include <boost/format.hpp> -#include <iostream> #include <list> using namespace uhd; @@ -131,7 +131,7 @@ public: _pending_recv_buffs(_num_recv_frames), _pending_send_buffs(_num_send_frames) { - //std::cout << boost::format("Creating udp transport for %s %s") % addr % port << std::endl; + UHD_LOG << boost::format("Creating udp transport for %s %s") % addr % port << std::endl; //resolve the address asio::ip::udp::resolver resolver(_io_service); @@ -275,17 +275,16 @@ template<typename Opt> static void resize_buff_helper( //resize the buffer if size was provided if (target_size > 0){ size_t actual_size = udp_trans->resize_buff<Opt>(target_size); - if (target_size != actual_size) std::cout << boost::format( + UHD_LOG << boost::format( "Target %s sock buff size: %d bytes\n" "Actual %s sock buff size: %d bytes" ) % name % target_size % name % actual_size << std::endl; - else std::cout << boost::format( - "Current %s sock buff size: %d bytes" - ) % name % actual_size << std::endl; - if (actual_size < target_size) uhd::warning::post(str(boost::format( + if (actual_size < target_size) UHD_MSG(warning) << boost::format( "The %s buffer could not be resized sufficiently.\n" + "Target sock buff size: %d bytes.\n" + "Actual sock buff size: %d bytes.\n" "See the transport application notes on buffer resizing.\n%s" - ) % name % help_message)); + ) % name % target_size % actual_size % help_message; } } |