aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/transport/nirio/rpc/rpc_client.cpp5
-rw-r--r--host/lib/usrp/multi_usrp.cpp30
-rw-r--r--host/lib/utils/log.cpp6
3 files changed, 33 insertions, 8 deletions
diff --git a/host/lib/transport/nirio/rpc/rpc_client.cpp b/host/lib/transport/nirio/rpc/rpc_client.cpp
index f8dc26b50..0c4b8fe3c 100644
--- a/host/lib/transport/nirio/rpc/rpc_client.cpp
+++ b/host/lib/transport/nirio/rpc/rpc_client.cpp
@@ -104,6 +104,11 @@ rpc_client::rpc_client (
} catch (boost::exception&) {
UHD_LOG << "rpc_client connection request cancelled/aborted." << std::endl;
_exec_err.assign(boost::asio::error::connection_aborted, boost::asio::error::get_system_category());
+#if BOOST_VERSION < 104700
+ } catch (std::exception& e) {
+ UHD_LOG << "rpc_client connection error: " << e.what() << std::endl;
+ _exec_err.assign(boost::asio::error::connection_aborted, boost::asio::error::get_system_category());
+#endif
}
}
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index 166b0cb37..71b1f8995 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -747,7 +747,11 @@ public:
void set_rx_dc_offset(const bool enb, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<bool>(rx_fe_root(chan) / "dc_offset" / "enable").set(enb);
+ if (_tree->exists(rx_fe_root(chan) / "dc_offset" / "enable")) {
+ _tree->access<bool>(rx_fe_root(chan) / "dc_offset" / "enable").set(enb);
+ } else {
+ UHD_MSG(warning) << "Setting DC offset compensation is not possible on this device." << std::endl;
+ }
return;
}
for (size_t c = 0; c < get_rx_num_channels(); c++){
@@ -757,7 +761,11 @@ public:
void set_rx_dc_offset(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(rx_fe_root(chan) / "dc_offset" / "value").set(offset);
+ if (_tree->exists(rx_fe_root(chan) / "dc_offset" / "value")) {
+ _tree->access<std::complex<double> >(rx_fe_root(chan) / "dc_offset" / "value").set(offset);
+ } else {
+ UHD_MSG(warning) << "Setting DC offset is not possible on this device." << std::endl;
+ }
return;
}
for (size_t c = 0; c < get_rx_num_channels(); c++){
@@ -767,7 +775,11 @@ public:
void set_rx_iq_balance(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(rx_fe_root(chan) / "iq_balance" / "value").set(offset);
+ if (_tree->exists(rx_fe_root(chan) / "iq_balance" / "value")) {
+ _tree->access<std::complex<double> >(rx_fe_root(chan) / "iq_balance" / "value").set(offset);
+ } else {
+ UHD_MSG(warning) << "Setting IQ balance is not possible on this device." << std::endl;
+ }
return;
}
for (size_t c = 0; c < get_rx_num_channels(); c++){
@@ -933,7 +945,11 @@ public:
void set_tx_dc_offset(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(tx_fe_root(chan) / "dc_offset" / "value").set(offset);
+ if (_tree->exists(tx_fe_root(chan) / "dc_offset" / "value")) {
+ _tree->access<std::complex<double> >(tx_fe_root(chan) / "dc_offset" / "value").set(offset);
+ } else {
+ UHD_MSG(warning) << "Setting DC offset is not possible on this device." << std::endl;
+ }
return;
}
for (size_t c = 0; c < get_tx_num_channels(); c++){
@@ -943,7 +959,11 @@ public:
void set_tx_iq_balance(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
- _tree->access<std::complex<double> >(tx_fe_root(chan) / "iq_balance" / "value").set(offset);
+ if (_tree->exists(tx_fe_root(chan) / "iq_balance" / "value")) {
+ _tree->access<std::complex<double> >(tx_fe_root(chan) / "iq_balance" / "value").set(offset);
+ } else {
+ UHD_MSG(warning) << "Setting IQ balance is not possible on this device." << std::endl;
+ }
return;
}
for (size_t c = 0; c < get_tx_num_channels(); c++){
diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp
index d6d1786c7..31ee0c991 100644
--- a/host/lib/utils/log.cpp
+++ b/host/lib/utils/log.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2012 Ettus Research LLC
+// Copyright 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
@@ -117,11 +117,11 @@ UHD_SINGLETON_FCN(log_resource_type, log_rs);
**********************************************************************/
//! get the relative file path from the host directory
static std::string get_rel_file_path(const fs::path &file){
- fs::path abs_path = file.branch_path();
+ fs::path abs_path = file.parent_path();
fs::path rel_path = file.leaf();
while (not abs_path.empty() and abs_path.leaf() != "host"){
rel_path = abs_path.leaf() / rel_path;
- abs_path = abs_path.branch_path();
+ abs_path = abs_path.parent_path();
}
return rel_path.string();
}