diff options
| author | Ashish Chaudhari <ashish@ettus.com> | 2017-06-15 15:40:09 -0700 | 
|---|---|---|
| committer | Ashish Chaudhari <ashish@ettus.com> | 2017-06-15 15:40:09 -0700 | 
| commit | ea2a5c6e6756ec228d87c787e80c4921b1ca763e (patch) | |
| tree | be8dd95986d74658485f4767af331aebd36734af /host/lib | |
| parent | 6270f79a56635fca8484f120e8c4bb8874fdc903 (diff) | |
| download | uhd-ea2a5c6e6756ec228d87c787e80c4921b1ca763e.tar.gz uhd-ea2a5c6e6756ec228d87c787e80c4921b1ca763e.tar.bz2 uhd-ea2a5c6e6756ec228d87c787e80c4921b1ca763e.zip  | |
x300: Added location info to FW ctrl error messages
Diffstat (limited to 'host/lib')
| -rw-r--r-- | host/lib/transport/udp_simple.cpp | 4 | ||||
| -rw-r--r-- | host/lib/usrp/x300/x300_fw_ctrl.cpp | 16 | 
2 files changed, 18 insertions, 2 deletions
diff --git a/host/lib/transport/udp_simple.cpp b/host/lib/transport/udp_simple.cpp index 9fe285376..75862d1a9 100644 --- a/host/lib/transport/udp_simple.cpp +++ b/host/lib/transport/udp_simple.cpp @@ -64,6 +64,10 @@ public:          return _recv_endpoint.address().to_string();      } +    std::string get_send_addr(void){ +        return _send_endpoint.address().to_string(); +    } +  private:      bool                    _connected;      asio::io_service        _io_service; diff --git a/host/lib/usrp/x300/x300_fw_ctrl.cpp b/host/lib/usrp/x300/x300_fw_ctrl.cpp index 5ff40c966..38b7eb139 100644 --- a/host/lib/usrp/x300/x300_fw_ctrl.cpp +++ b/host/lib/usrp/x300/x300_fw_ctrl.cpp @@ -28,6 +28,7 @@  #include "x300_regs.hpp"  #include <boost/date_time/posix_time/posix_time.hpp>  #include <boost/thread/thread.hpp> +#include <boost/lexical_cast.hpp>  using namespace uhd;  using namespace uhd::niusrprio; @@ -60,7 +61,7 @@ public:              catch(const uhd::io_error &ex)              {                  std::string error_msg = str(boost::format( -                    "x300 fw communication failure #%u\n%s") % i % ex.what()); +                    "%s: x300 fw communication failure #%u\n%s") % __loc_info() % i % ex.what());                  if (errors) UHD_LOGGER_ERROR("X300") << error_msg ;                  if (i == num_retries) throw uhd::io_error(error_msg);              } @@ -80,7 +81,7 @@ public:              catch(const uhd::io_error &ex)              {                  std::string error_msg = str(boost::format( -                    "x300 fw communication failure #%u\n%s") % i % ex.what()); +                    "%s: x300 fw communication failure #%u\n%s") % __loc_info() % i % ex.what());                  if (errors) UHD_LOGGER_ERROR("X300") << error_msg ;                  if (i == num_retries) throw uhd::io_error(error_msg);              } @@ -94,6 +95,7 @@ protected:      virtual void __poke32(const wb_addr_type addr, const uint32_t data) = 0;      virtual uint32_t __peek32(const wb_addr_type addr) = 0;      virtual void __flush() = 0; +    virtual std::string __loc_info() = 0;      boost::mutex reg_access;  }; @@ -182,6 +184,11 @@ protected:          while (udp->recv(boost::asio::buffer(buff), 0.0)){} //flush      } +    virtual std::string __loc_info(void) +    { +        return udp->get_send_addr(); +    } +  private:      uhd::transport::udp_simple::sptr udp;      size_t seq; @@ -290,6 +297,11 @@ protected:          __peek32(0);      } +    virtual std::string __loc_info(void) +    { +        return boost::lexical_cast<std::string>(_drv_proxy->get_interface_num()); +    } +  private:      niriok_proxy::sptr _drv_proxy;      static const uint32_t READ_TIMEOUT_IN_MS = 100;  | 
