diff options
author | Josh Blum <josh@joshknows.com> | 2010-01-12 16:59:03 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-01-12 16:59:03 -0800 |
commit | 8fdffd2f77016fe95f4a78e16d2d728b650b4d05 (patch) | |
tree | d3cd9a5e2be1f77c034943f9711c7ca83f711083 /lib/usrp/dboard/base.cpp | |
parent | 087b97e0fc28793ea39d81e60b3fddae51c5929e (diff) | |
download | uhd-8fdffd2f77016fe95f4a78e16d2d728b650b4d05.tar.gz uhd-8fdffd2f77016fe95f4a78e16d2d728b650b4d05.tar.bz2 uhd-8fdffd2f77016fe95f4a78e16d2d728b650b4d05.zip |
Added base classes for the usrp dboards to inherit.
Added a manager class for the subdevs that will create devices,
and give out proxies to handle them.
Diffstat (limited to 'lib/usrp/dboard/base.cpp')
-rw-r--r-- | lib/usrp/dboard/base.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/lib/usrp/dboard/base.cpp b/lib/usrp/dboard/base.cpp new file mode 100644 index 000000000..3166cdedc --- /dev/null +++ b/lib/usrp/dboard/base.cpp @@ -0,0 +1,67 @@ +// +// Copyright 2010 Ettus Research LLC +// + +#include <usrp_uhd/usrp/dboard/base.hpp> + +using namespace usrp_uhd::usrp::dboard; + +/*********************************************************************** + * xcvr dboard base class + **********************************************************************/ +xcvr_base::xcvr_base(size_t subdev_index, interface::sptr dboard_interface) + : _subdev_index(subdev_index), _dboard_interface(dboard_interface){ + /* NOP */ +} + +xcvr_base::~xcvr_base(void){ + /* NOP */ +} + +size_t xcvr_base::get_subdev_index(void){ + return _subdev_index; +} + +interface::sptr xcvr_base::get_interface(void){ + return _dboard_interface; +} + +/*********************************************************************** + * rx dboard base class + **********************************************************************/ +rx_base::rx_base(size_t subdev_index, interface::sptr dboard_interface) +: xcvr_base(subdev_index, dboard_interface){ + /* NOP */ +} + +rx_base::~rx_base(void){ + /* NOP */ +} + +void rx_base::tx_get(const wax::type &key, wax::type &val){ + throw std::runtime_error("cannot call tx_get on a rx dboard"); +} + +void rx_base::tx_set(const wax::type &key, const wax::type &val){ + throw std::runtime_error("cannot call tx_set on a rx dboard"); +} + +/*********************************************************************** + * tx dboard base class + **********************************************************************/ +tx_base::tx_base(size_t subdev_index, interface::sptr dboard_interface) +: xcvr_base(subdev_index, dboard_interface){ + /* NOP */ +} + +tx_base::~tx_base(void){ + /* NOP */ +} + +void tx_base::rx_get(const wax::type &key, wax::type &val){ + throw std::runtime_error("cannot call rx_get on a tx dboard"); +} + +void tx_base::rx_set(const wax::type &key, const wax::type &val){ + throw std::runtime_error("cannot call rx_set on a tx dboard"); +} |