diff options
author | Josh Blum <josh@joshknows.com> | 2010-02-21 22:15:30 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-02-21 22:15:30 -0800 |
commit | 3e5898fa11d9e77421cf0d3853acc49fbf4801ca (patch) | |
tree | 8f04464a8246bcfdb858a27c313adc614427c469 /host/include | |
parent | add5d32f9b0cb3cda15624fb7aef3998096ff3f6 (diff) | |
download | uhd-3e5898fa11d9e77421cf0d3853acc49fbf4801ca.tar.gz uhd-3e5898fa11d9e77421cf0d3853acc49fbf4801ca.tar.bz2 uhd-3e5898fa11d9e77421cf0d3853acc49fbf4801ca.zip |
Made the usrp2 impl into a device.
Removed the usrp device wrapper and usrp2 cpp file outside of the usrp2 lib dir.
Also removed the mboard base files since we wont be needing them.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/usrp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/include/uhd/usrp/mboard_base.hpp | 45 | ||||
-rw-r--r-- | host/include/uhd/usrp/usrp.hpp | 53 | ||||
-rw-r--r-- | host/include/uhd/usrp/usrp2.hpp | 21 |
4 files changed, 9 insertions, 112 deletions
diff --git a/host/include/uhd/usrp/CMakeLists.txt b/host/include/uhd/usrp/CMakeLists.txt index 4b49e315f..e7bdc1784 100644 --- a/host/include/uhd/usrp/CMakeLists.txt +++ b/host/include/uhd/usrp/CMakeLists.txt @@ -21,8 +21,6 @@ INSTALL(FILES dboard_id.hpp dboard_interface.hpp dboard_manager.hpp - mboard_base.hpp usrp2.hpp - usrp.hpp DESTINATION ${HEADER_DIR}/uhd/usrp ) diff --git a/host/include/uhd/usrp/mboard_base.hpp b/host/include/uhd/usrp/mboard_base.hpp deleted file mode 100644 index 498a46681..000000000 --- a/host/include/uhd/usrp/mboard_base.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright 2010 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 -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// - -#ifndef INCLUDED_UHD_USRP_MBOARD_BASE_HPP -#define INCLUDED_UHD_USRP_MBOARD_BASE_HPP - -#include <uhd/wax.hpp> -#include <boost/utility.hpp> -#include <boost/shared_ptr.hpp> - -namespace uhd{ namespace usrp{ - -/*! - * A mboard_base class for usrp mboard objects. - */ -class mboard_base : boost::noncopyable, public wax::obj{ -public: - typedef boost::shared_ptr<mboard_base> sptr; - mboard_base(void); - ~mboard_base(void); - - //TODO other api calls - -private: - virtual void get(const wax::obj &, wax::obj &) = 0; - virtual void set(const wax::obj &, const wax::obj &) = 0; -}; - -}} //namespace - -#endif /* INCLUDED_UHD_USRP_MBOARD_BASE_HPP */ diff --git a/host/include/uhd/usrp/usrp.hpp b/host/include/uhd/usrp/usrp.hpp deleted file mode 100644 index cc5ed601e..000000000 --- a/host/include/uhd/usrp/usrp.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright 2010 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 -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// - -#include <uhd/device.hpp> -#include <uhd/usrp/mboard_base.hpp> -#include <uhd/dict.hpp> - -#ifndef INCLUDED_UHD_USRP_USRP_HPP -#define INCLUDED_UHD_USRP_USRP_HPP - -namespace uhd{ namespace usrp{ - -/*! - * A usrp device provides a device-level interface to usrp mboards. - * In most cases, a usrp device will have only one mboard. - * In the usrp2 mimo case, this device will have two mboards, - * where one talks through the other's control port. - */ -class usrp : public device{ -public: - usrp(const device_addr_t &device_addr); - ~usrp(void); - - //the io interface - void send_raw(const std::vector<boost::asio::const_buffer> &); - uhd::shared_iovec recv_raw(void); - -private: - void get(const wax::obj &, wax::obj &); - void set(const wax::obj &, const wax::obj &); - - uhd::dict<std::string, mboard_base::sptr> _mboards; - boost::function<void(const std::vector<boost::asio::const_buffer> &)> _send_raw_cb; - boost::function<uhd::shared_iovec(void)> _recv_raw_cb; -}; - -}} //namespace - -#endif /* INCLUDED_UHD_USRP_USRP_HPP */ diff --git a/host/include/uhd/usrp/usrp2.hpp b/host/include/uhd/usrp/usrp2.hpp index 68d4c513c..f6e49cbd6 100644 --- a/host/include/uhd/usrp/usrp2.hpp +++ b/host/include/uhd/usrp/usrp2.hpp @@ -18,15 +18,14 @@ #ifndef INCLUDED_UHD_USRP_MBOARD_USRP2_HPP #define INCLUDED_UHD_USRP_MBOARD_USRP2_HPP -#include <uhd/usrp/mboard_base.hpp> -#include <uhd/device_addr.hpp> +#include <uhd/device.hpp> namespace uhd{ namespace usrp{ /*! - * The usrp2 mboard class. + * The usrp2 device class. */ -class usrp2 : public mboard_base{ +class usrp2 : public device{ public: /*! * Discover usrp2 devices over the ethernet. @@ -36,14 +35,12 @@ public: */ static device_addrs_t discover(const device_addr_t &hint); - usrp2(const device_addr_t &); - ~usrp2(void); - -private: - void get(const wax::obj &, wax::obj &); - void set(const wax::obj &, const wax::obj &); - - wax::obj _impl; + /*! + * Make a usrp2 from a device address. + * \param addr the device address + * \return a device sptr to a new usrp2 + */ + static device::sptr make(const device_addr_t &addr); }; }} //namespace |