aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/codec_ctrl.cpp2
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp18
-rw-r--r--host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp2
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp6
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp30
5 files changed, 29 insertions, 29 deletions
diff --git a/host/lib/usrp/usrp2/codec_ctrl.cpp b/host/lib/usrp/usrp2/codec_ctrl.cpp
index 043564727..15bcce4bf 100644
--- a/host/lib/usrp/usrp2/codec_ctrl.cpp
+++ b/host/lib/usrp/usrp2/codec_ctrl.cpp
@@ -197,7 +197,7 @@ private:
void send_ad9777_reg(uint8_t addr){
uint16_t reg = _ad9777_regs.get_write_reg(addr);
- UHD_LOGV(always) << "send_ad9777_reg: " << std::hex << reg << std::endl;
+ UHD_LOGGER_DEBUG("USRP2") << "send_ad9777_reg: " << std::hex << reg;
_spiface->write_spi(
SPI_SS_AD9777, spi_config_t::EDGE_RISE,
reg, 16
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 3c10c6e79..992d70835 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -23,7 +23,7 @@
#include "usrp2_regs.hpp"
#include "fw_common.h"
#include <uhd/utils/log.hpp>
-#include <uhd/utils/msg.hpp>
+
#include <uhd/utils/tasks.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/byteswap.hpp>
@@ -209,7 +209,7 @@ void usrp2_impl::io_impl::recv_pirate_loop(
fc_mon.update_fc_condition(uhd::ntohx(fc_word32));
continue;
}
- //else UHD_MSG(often) << "metadata.event_code " << metadata.event_code << std::endl;
+ //else UHD_LOGGER_DEBUG("USRP2") << "metadata.event_code " << metadata.event_code;
async_msg_fifo.push_with_pop_on_full(metadata);
standard_async_msg_prints(metadata);
@@ -218,7 +218,7 @@ void usrp2_impl::io_impl::recv_pirate_loop(
//TODO unknown received packet, may want to print error...
}
}catch(const std::exception &e){
- UHD_MSG(error) << "Error in recv pirate loop: " << e.what() << std::endl;
+ UHD_LOGGER_ERROR("USRP2") << "Error in recv pirate loop: " << e.what() ;
}
}
}
@@ -375,10 +375,10 @@ void usrp2_impl::program_stream_dest(
//user has provided an alternative address and port for destination
if (args.args.has_key("addr") and args.args.has_key("port")){
- UHD_MSG(status) << boost::format(
- "Programming streaming destination for custom address.\n"
- "IPv4 Address: %s, UDP Port: %s\n"
- ) % args.args["addr"] % args.args["port"] << std::endl;
+ UHD_LOGGER_INFO("USRP2") << boost::format(
+ "Programming streaming destination for custom address. "
+ "IPv4 Address: %s, UDP Port: %s"
+ ) % args.args["addr"] % args.args["port"];
asio::io_service io_service;
asio::ip::udp::resolver resolver(io_service);
@@ -388,7 +388,7 @@ void usrp2_impl::program_stream_dest(
stream_ctrl.udp_port = uhd::htonx(uint32_t(endpoint.port()));
for (size_t i = 0; i < 3; i++){
- UHD_MSG(status) << "ARP attempt " << i << std::endl;
+ UHD_LOGGER_INFO("USRP2") << "ARP attempt " << i;
managed_send_buffer::sptr send_buff = xport->get_send_buff();
std::memcpy(send_buff->cast<void *>(), &stream_ctrl, sizeof(stream_ctrl));
send_buff->commit(sizeof(stream_ctrl));
@@ -398,7 +398,7 @@ void usrp2_impl::program_stream_dest(
if (recv_buff and recv_buff->size() >= sizeof(uint32_t)){
const uint32_t result = uhd::ntohx(recv_buff->cast<const uint32_t *>()[0]);
if (result == 0){
- UHD_MSG(status) << "Success! " << std::endl;
+ UHD_LOGGER_INFO("USRP2") << "Success! ";
return;
}
}
diff --git a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
index 9cd3afc6c..cdd26bbc4 100644
--- a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
@@ -17,7 +17,7 @@
#include "usrp2_regs.hpp"
#include <uhd/exception.hpp>
-#include <uhd/utils/msg.hpp>
+#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/transport/vrt_if_packet.hpp>
#include "usrp2_fifo_ctrl.hpp"
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 100cec867..ce547bad0 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -20,7 +20,7 @@
#include "fw_common.h"
#include "usrp2_iface.hpp"
#include <uhd/exception.hpp>
-#include <uhd/utils/msg.hpp>
+#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/paths.hpp>
@@ -268,10 +268,10 @@ public:
return ctrl_send_and_recv_internal(out_data, lo, hi, CTRL_RECV_TIMEOUT/CTRL_RECV_RETRIES);
}
catch(const timeout_error &e){
- UHD_MSG(error)
+ UHD_LOGGER_ERROR("USRP2")
<< "Control packet attempt " << i
<< ", sequence number " << _ctrl_seq_num
- << ":\n" << e.what() << std::endl;
+ << ":\n" << e.what() ;
}
}
throw uhd::runtime_error("link dead: timeout waiting for control packet ACK");
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 24756f0ef..7d8f59fb8 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -19,7 +19,7 @@
#include "fw_common.h"
#include "apply_corrections.hpp"
#include <uhd/utils/log.hpp>
-#include <uhd/utils/msg.hpp>
+
#include <uhd/exception.hpp>
#include <uhd/transport/if_addrs.hpp>
#include <uhd/transport/udp_zero_copy.hpp>
@@ -105,7 +105,7 @@ device_addrs_t usrp2_find(const device_addr_t &hint_){
udp_transport = udp_simple::make_broadcast(hint["addr"], BOOST_STRINGIZE(USRP2_UDP_CTRL_PORT));
}
catch(const std::exception &e){
- UHD_MSG(error) << boost::format("Cannot open UDP transport on %s\n%s") % hint["addr"] % e.what() << std::endl;
+ UHD_LOGGER_ERROR("USRP2") << boost::format("Cannot open UDP transport on %s\n%s") % hint["addr"] % e.what() ;
return usrp2_addrs; //dont throw, but return empty address so caller can insert
}
@@ -119,11 +119,11 @@ device_addrs_t usrp2_find(const device_addr_t &hint_){
}
catch(const std::exception &ex)
{
- UHD_MSG(error) << "USRP2 Network discovery error " << ex.what() << std::endl;
+ UHD_LOGGER_ERROR("USRP2") << "USRP2 Network discovery error " << ex.what() ;
}
catch(...)
{
- UHD_MSG(error) << "USRP2 Network discovery unknown error " << std::endl;
+ UHD_LOGGER_ERROR("USRP2") << "USRP2 Network discovery unknown error " ;
}
//loop and recieve until the timeout
@@ -318,7 +318,7 @@ static zero_copy_if::sptr make_xport(
usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
device_addr(_device_addr)
{
- UHD_MSG(status) << "Opening a USRP2/N-Series device..." << std::endl;
+ UHD_LOGGER_INFO("USRP2") << "Opening a USRP2/N-Series device...";
//setup the dsp transport hints (default to a large recv buff)
if (not device_addr.has_key("recv_buff_size")){
@@ -355,8 +355,8 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
device_addr["recv_frame_size"] = boost::lexical_cast<std::string>(mtu.recv_mtu);
device_addr["send_frame_size"] = boost::lexical_cast<std::string>(mtu.send_mtu);
- UHD_MSG(status) << boost::format("Current recv frame size: %d bytes") % mtu.recv_mtu << std::endl;
- UHD_MSG(status) << boost::format("Current send frame size: %d bytes") % mtu.send_mtu << std::endl;
+ UHD_LOGGER_INFO("USRP2") << boost::format("Current recv frame size: %d bytes") % mtu.recv_mtu;
+ UHD_LOGGER_INFO("USRP2") << boost::format("Current send frame size: %d bytes") % mtu.send_mtu;
}
catch(const uhd::not_implemented_error &){
//just ignore this error, makes older fw work...
@@ -411,7 +411,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
// handle case where the MB EEPROM is not programmed
if (fpga_major == USRP2_FPGA_COMPAT_NUM or fpga_major == N200_FPGA_COMPAT_NUM)
{
- UHD_MSG(warning) << "Unable to identify device - assuming USRP2/N-Series device" << std::endl;
+ UHD_LOGGER_WARNING("USRP2") << "Unable to identify device - assuming USRP2/N-Series device" ;
expected_fpga_compat_num = fpga_major;
}
}
@@ -432,19 +432,19 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
////////////////////////////////////////////////////////////////
// construct transports for RX and TX DSPs
////////////////////////////////////////////////////////////////
- UHD_LOG << "Making transport for RX DSP0..." << std::endl;
+ UHD_LOGGER_DEBUG("USRP2") << "Making transport for RX DSP0..." ;
_mbc[mb].rx_dsp_xports.push_back(make_xport(
addr, BOOST_STRINGIZE(USRP2_UDP_RX_DSP0_PORT), device_args_i, "recv"
));
- UHD_LOG << "Making transport for RX DSP1..." << std::endl;
+ UHD_LOGGER_DEBUG("USRP2") << "Making transport for RX DSP1..." ;
_mbc[mb].rx_dsp_xports.push_back(make_xport(
addr, BOOST_STRINGIZE(USRP2_UDP_RX_DSP1_PORT), device_args_i, "recv"
));
- UHD_LOG << "Making transport for TX DSP0..." << std::endl;
+ UHD_LOGGER_DEBUG("USRP2") << "Making transport for TX DSP0..." ;
_mbc[mb].tx_dsp_xport = make_xport(
addr, BOOST_STRINGIZE(USRP2_UDP_TX_DSP0_PORT), device_args_i, "send"
);
- UHD_LOG << "Making transport for Control..." << std::endl;
+ UHD_LOGGER_DEBUG("USRP2") << "Making transport for Control..." ;
_mbc[mb].fifo_ctrl_xport = make_xport(
addr, BOOST_STRINGIZE(USRP2_UDP_FIFO_CRTL_PORT), device_addr_t(), ""
);
@@ -535,14 +535,14 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
//otherwise if not disabled, look for the internal GPSDO
if (_mbc[mb].iface->peekfw(U2_FW_REG_HAS_GPSDO) != dont_look_for_gpsdo)
{
- UHD_MSG(status) << "Detecting internal GPSDO.... " << std::flush;
+ UHD_LOGGER_INFO("USRP2") << "Detecting internal GPSDO.... ";
try{
_mbc[mb].gps = gps_ctrl::make(udp_simple::make_uart(udp_simple::make_connected(
addr, BOOST_STRINGIZE(USRP2_UDP_UART_GPS_PORT)
)));
}
catch(std::exception &e){
- UHD_MSG(error) << "An error occurred making GPSDO control: " << e.what() << std::endl;
+ UHD_LOGGER_ERROR("USRP2") << "An error occurred making GPSDO control: " << e.what() ;
}
if (_mbc[mb].gps and _mbc[mb].gps->gps_detected())
{
@@ -777,7 +777,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
//GPS installed: use external ref, time, and init time spec
if (_mbc[mb].gps and _mbc[mb].gps->gps_detected()){
_mbc[mb].time64->enable_gpsdo();
- UHD_MSG(status) << "Setting references to the internal GPSDO" << std::endl;
+ UHD_LOGGER_INFO("USRP2") << "Setting references to the internal GPSDO" ;
_tree->access<std::string>(root / "time_source/value").set("gpsdo");
_tree->access<std::string>(root / "clock_source/value").set("gpsdo");
}