From 3e5898fa11d9e77421cf0d3853acc49fbf4801ca Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 21 Feb 2010 22:15:30 -0800 Subject: 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. --- host/include/uhd/usrp/CMakeLists.txt | 2 -- host/include/uhd/usrp/mboard_base.hpp | 45 ----------------------------- host/include/uhd/usrp/usrp.hpp | 53 ----------------------------------- host/include/uhd/usrp/usrp2.hpp | 21 ++++++-------- 4 files changed, 9 insertions(+), 112 deletions(-) delete mode 100644 host/include/uhd/usrp/mboard_base.hpp delete mode 100644 host/include/uhd/usrp/usrp.hpp (limited to 'host/include') 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 . -// - -#ifndef INCLUDED_UHD_USRP_MBOARD_BASE_HPP -#define INCLUDED_UHD_USRP_MBOARD_BASE_HPP - -#include -#include -#include - -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 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 . -// - -#include -#include -#include - -#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 &); - uhd::shared_iovec recv_raw(void); - -private: - void get(const wax::obj &, wax::obj &); - void set(const wax::obj &, const wax::obj &); - - uhd::dict _mboards; - boost::function &)> _send_raw_cb; - boost::function _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 -#include +#include 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 -- cgit v1.2.3