diff options
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/usrp/CMakeLists.txt | 1 | ||||
-rw-r--r-- | host/include/uhd/usrp/usrp_e.hpp | 54 | ||||
-rw-r--r-- | host/include/uhd/utils/assert.hpp | 4 | ||||
-rw-r--r-- | host/include/uhd/utils/props.hpp | 4 | ||||
-rw-r--r-- | host/include/uhd/utils/safe_main.hpp | 6 |
5 files changed, 66 insertions, 3 deletions
diff --git a/host/include/uhd/usrp/CMakeLists.txt b/host/include/uhd/usrp/CMakeLists.txt index bbd124ed8..ff2636d8c 100644 --- a/host/include/uhd/usrp/CMakeLists.txt +++ b/host/include/uhd/usrp/CMakeLists.txt @@ -32,6 +32,7 @@ INSTALL(FILES dboard_manager.hpp ### usrp headers ### + usrp_e.hpp usrp2.hpp ### utilities ### diff --git a/host/include/uhd/usrp/usrp_e.hpp b/host/include/uhd/usrp/usrp_e.hpp new file mode 100644 index 000000000..557058261 --- /dev/null +++ b/host/include/uhd/usrp/usrp_e.hpp @@ -0,0 +1,54 @@ +// +// 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_USRP_E_HPP +#define INCLUDED_UHD_USRP_USRP_E_HPP + +#include <uhd/config.hpp> +#include <uhd/device.hpp> + +namespace uhd{ namespace usrp{ + +/*! + * The USRP-Embedded device class. + */ +class UHD_API usrp_e : public device{ +public: + /*! + * Find usrp_e devices on the system via the device node. + * \param hint a device addr with the usrp_e address filled in + * \return a vector of device addresses for all usrp-e's found + */ + static device_addrs_t find(const device_addr_t &hint); + + /*! + * Make a usrp_e from a device address. + * \param addr the device address + * \return a device sptr to a new usrp_e + */ + static device::sptr make(const device_addr_t &addr); + + /*! + * Load the FPGA with an image file. + * \param bin_file the name of the fpga image file + */ + static void load_fpga(const std::string &bin_file); +}; + +}} //namespace + +#endif /* INCLUDED_UHD_USRP_USRP_E_HPP */ diff --git a/host/include/uhd/utils/assert.hpp b/host/include/uhd/utils/assert.hpp index ed0a95535..6aca64f8c 100644 --- a/host/include/uhd/utils/assert.hpp +++ b/host/include/uhd/utils/assert.hpp @@ -28,6 +28,10 @@ #include <stdexcept> #include <string> +#ifndef BOOST_THROW_EXCEPTION +#define BOOST_THROW_EXCEPTION(x) throw std::runtime_error("") +#endif + namespace uhd{ //! The exception to throw when assertions fail diff --git a/host/include/uhd/utils/props.hpp b/host/include/uhd/utils/props.hpp index 516102a5f..6c40c32e0 100644 --- a/host/include/uhd/utils/props.hpp +++ b/host/include/uhd/utils/props.hpp @@ -27,6 +27,10 @@ #include <vector> #include <string> +#ifndef BOOST_THROW_EXCEPTION +#define BOOST_THROW_EXCEPTION(x) throw std::runtime_error("") +#endif + namespace uhd{ //! The type for a vector of property names diff --git a/host/include/uhd/utils/safe_main.hpp b/host/include/uhd/utils/safe_main.hpp index a4e4e06e8..39d2282cd 100644 --- a/host/include/uhd/utils/safe_main.hpp +++ b/host/include/uhd/utils/safe_main.hpp @@ -19,7 +19,7 @@ #define INCLUDED_UHD_UTILS_SAFE_MAIN_HPP #include <uhd/config.hpp> -#include <boost/exception/diagnostic_information.hpp> +//#include <boost/exception/diagnostic_information.hpp> #include <iostream> #include <stdexcept> @@ -34,9 +34,9 @@ int main(int argc, char *argv[]){ \ try { \ return _main(argc, argv); \ - } catch(const boost::exception &e){ \ + } /*catch(const boost::exception &e){ \ std::cerr << "Error: " << boost::diagnostic_information(e) << std::endl; \ - } catch(const std::exception &e) { \ + }*/ catch(const std::exception &e) { \ std::cerr << "Error: " << e.what() << std::endl; \ } catch(...) { \ std::cerr << "Error: unknown exception" << std::endl; \ |