diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-25 22:05:50 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-25 22:05:50 -0700 |
commit | 61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688 (patch) | |
tree | 12cfaf308bcbd779dd5a1254b12a6104088629cc /host/lib/usrp/usrp2/dboard_impl.cpp | |
parent | d1d6c859f0dbae5f044519d589d5ad3fcbb8643e (diff) | |
download | uhd-61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688.tar.gz uhd-61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688.tar.bz2 uhd-61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688.zip |
Work on exceptions.
Added props exception macro to make the set/get prop switch statements easier.
Made use of boost throw exception macro for throw-site information in throw assert.
Diffstat (limited to 'host/lib/usrp/usrp2/dboard_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/dboard_impl.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp index 8952a9f75..043609458 100644 --- a/host/lib/usrp/usrp2/dboard_impl.cpp +++ b/host/lib/usrp/usrp2/dboard_impl.cpp @@ -123,8 +123,7 @@ void usrp2_impl::rx_dboard_get(const wax::obj &key_, wax::obj &val){ val = _rx_db_eeprom.id; return; - //case DBOARD_PROP_CODEC: - // throw std::runtime_error("unhandled prop in usrp2 dboard"); + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -140,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, _tx_db_eeprom.get_eeprom_bytes()); return; - default: throw std::runtime_error("Cannot set read-only property on usrp2 dboard"); + default: UHD_THROW_PROP_READ_ONLY(); } } @@ -173,8 +172,7 @@ void usrp2_impl::tx_dboard_get(const wax::obj &key_, wax::obj &val){ val = _tx_db_eeprom.id; return; - //case DBOARD_PROP_CODEC: - // throw std::runtime_error("unhandled prop in usrp2 dboard"); + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -190,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: throw std::runtime_error("Cannot set read-only property on usrp2 dboard"); + default: UHD_THROW_PROP_READ_ONLY(); } } |