diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-26 15:20:18 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-26 15:20:18 -0700 |
commit | 6f1bdcb58608e3a7c2625841e3a8f1c6297bb544 (patch) | |
tree | 41434e1b13c97538214b7d7c03f660ad921ca965 | |
parent | b1992806e130216fdab963c2154f489189b8c3b5 (diff) | |
download | uhd-6f1bdcb58608e3a7c2625841e3a8f1c6297bb544.tar.gz uhd-6f1bdcb58608e3a7c2625841e3a8f1c6297bb544.tar.bz2 uhd-6f1bdcb58608e3a7c2625841e3a8f1c6297bb544.zip |
Renamed the prop set/get error macros so they make sense for not-implemented properties.
-rw-r--r-- | host/include/uhd/utils/props.hpp | 12 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_basic_and_lf.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_rfx.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/dboard/db_xcvr2450.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dboard_impl.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dsp_impl.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 4 | ||||
-rw-r--r-- | host/test/gain_handler_test.cpp | 4 |
9 files changed, 32 insertions, 32 deletions
diff --git a/host/include/uhd/utils/props.hpp b/host/include/uhd/utils/props.hpp index 768655e36..516102a5f 100644 --- a/host/include/uhd/utils/props.hpp +++ b/host/include/uhd/utils/props.hpp @@ -66,18 +66,18 @@ namespace uhd{ typedef boost::error_info<struct tag_prop_info, std::string> prop_info; /*! - * Throw an error when trying to get a write only property. + * Throw when getting a not-implemented or write-only property. * Throw-site information will be included with this error. */ - #define UHD_THROW_PROP_WRITE_ONLY() \ - BOOST_THROW_EXCEPTION(uhd::prop_error() << uhd::prop_info("cannot get write-only property")) + #define UHD_THROW_PROP_GET_ERROR() \ + BOOST_THROW_EXCEPTION(uhd::prop_error() << uhd::prop_info("cannot get this property")) /*! - * Throw an error when trying to set a read only property. + * Throw when setting a not-implemented or read-only property. * Throw-site information will be included with this error. */ - #define UHD_THROW_PROP_READ_ONLY() \ - BOOST_THROW_EXCEPTION(uhd::prop_error() << uhd::prop_info("cannot set read-only property")) + #define UHD_THROW_PROP_SET_ERROR() \ + BOOST_THROW_EXCEPTION(uhd::prop_error() << uhd::prop_info("cannot set this property")) } //namespace uhd diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index fa53bd964..b0fbbd2ec 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -158,7 +158,7 @@ void basic_rx::rx_get(const wax::obj &key_, wax::obj &val){ val = true; //there is no LO, so it must be true! return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -180,7 +180,7 @@ void basic_rx::rx_set(const wax::obj &key_, const wax::obj &val){ case SUBDEV_PROP_FREQ: return; // it wont do you much good, but you can set it - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } @@ -257,7 +257,7 @@ void basic_tx::tx_get(const wax::obj &key_, wax::obj &val){ val = true; //there is no LO, so it must be true! return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -279,6 +279,6 @@ void basic_tx::tx_set(const wax::obj &key_, const wax::obj &val){ case SUBDEV_PROP_FREQ: return; // it wont do you much good, but you can set it - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 6ad5ad906..175f55eab 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -410,7 +410,7 @@ void rfx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){ val = this->get_locked(dboard_iface::UNIT_RX); return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -434,7 +434,7 @@ void rfx_xcvr::rx_set(const wax::obj &key_, const wax::obj &val){ set_rx_ant(val.as<std::string>()); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } @@ -503,7 +503,7 @@ void rfx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){ val = this->get_locked(dboard_iface::UNIT_TX); return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -527,6 +527,6 @@ void rfx_xcvr::tx_set(const wax::obj &key_, const wax::obj &val){ UHD_ASSERT_THROW(val.as<std::string>() == "TX/RX"); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 5b932904d..f1510da10 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -488,7 +488,7 @@ void xcvr2450::rx_get(const wax::obj &key_, wax::obj &val){ val = this->get_locked(); return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -511,7 +511,7 @@ void xcvr2450::rx_set(const wax::obj &key_, const wax::obj &val){ this->set_rx_ant(val.as<std::string>()); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } @@ -582,7 +582,7 @@ void xcvr2450::tx_get(const wax::obj &key_, wax::obj &val){ val = this->get_locked(); return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -605,6 +605,6 @@ void xcvr2450::tx_set(const wax::obj &key_, const wax::obj &val){ this->set_tx_ant(val.as<std::string>()); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp index 226a7950d..403faf5cf 100644 --- a/host/lib/usrp/usrp2/dboard_impl.cpp +++ b/host/lib/usrp/usrp2/dboard_impl.cpp @@ -123,7 +123,7 @@ void usrp2_impl::rx_dboard_get(const wax::obj &key_, wax::obj &val){ val = _rx_db_eeprom.id; return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -139,7 +139,7 @@ void usrp2_impl::rx_dboard_set(const wax::obj &key, const wax::obj &val){ _iface->write_eeprom(I2C_ADDR_RX_DB, 0, _rx_db_eeprom.get_eeprom_bytes()); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } @@ -172,7 +172,7 @@ void usrp2_impl::tx_dboard_get(const wax::obj &key_, wax::obj &val){ val = _tx_db_eeprom.id; return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -188,6 +188,6 @@ void usrp2_impl::tx_dboard_set(const wax::obj &key, const wax::obj &val){ _iface->write_eeprom(I2C_ADDR_TX_DB, 0, _tx_db_eeprom.get_eeprom_bytes()); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index 84c50ac0d..84314a656 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -118,7 +118,7 @@ void usrp2_impl::ddc_get(const wax::obj &key, wax::obj &val){ val = get_master_clock_freq()/_ddc_decim; return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -141,7 +141,7 @@ void usrp2_impl::ddc_set(const wax::obj &key, const wax::obj &val){ } return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } @@ -202,7 +202,7 @@ void usrp2_impl::duc_get(const wax::obj &key, wax::obj &val){ val = get_master_clock_freq()/_duc_interp; return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -225,6 +225,6 @@ void usrp2_impl::duc_set(const wax::obj &key, const wax::obj &val){ } return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 684cf245d..36bef4f25 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -248,7 +248,7 @@ void usrp2_impl::mboard_get(const wax::obj &key_, wax::obj &val){ val = _clock_config; return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -304,6 +304,6 @@ void usrp2_impl::mboard_set(const wax::obj &key, const wax::obj &val){ issue_ddc_stream_cmd(val.as<stream_cmd_t>()); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index d9b2248ff..4079357f9 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -202,10 +202,10 @@ void usrp2_impl::get(const wax::obj &key_, wax::obj &val){ val = size_t(_max_tx_samples_per_packet); return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } void usrp2_impl::set(const wax::obj &, const wax::obj &){ - UHD_THROW_PROP_READ_ONLY(); + UHD_THROW_PROP_SET_ERROR(); } diff --git a/host/test/gain_handler_test.cpp b/host/test/gain_handler_test.cpp index 0669b491a..5a9f2b714 100644 --- a/host/test/gain_handler_test.cpp +++ b/host/test/gain_handler_test.cpp @@ -73,7 +73,7 @@ private: val = _gain_values.keys(); return; - default: UHD_THROW_PROP_WRITE_ONLY(); + default: UHD_THROW_PROP_GET_ERROR(); } } @@ -89,7 +89,7 @@ private: _gain_values[name] = val.as<float>(); return; - default: UHD_THROW_PROP_READ_ONLY(); + default: UHD_THROW_PROP_SET_ERROR(); } } |