diff options
Diffstat (limited to 'host/include')
| -rw-r--r-- | host/include/uhd/convert.hpp | 8 | ||||
| -rw-r--r-- | host/include/uhd/transport/zero_copy.hpp | 106 | ||||
| -rw-r--r-- | host/include/uhd/usrp/mboard_eeprom.hpp | 18 | ||||
| -rw-r--r-- | host/include/uhd/usrp/multi_usrp.hpp | 35 | ||||
| -rw-r--r-- | host/include/uhd/utils/images.hpp | 17 | ||||
| -rw-r--r-- | host/include/uhd/utils/paths.hpp | 5 | ||||
| -rw-r--r-- | host/include/uhd/version.hpp | 2 | 
7 files changed, 109 insertions, 82 deletions
diff --git a/host/include/uhd/convert.hpp b/host/include/uhd/convert.hpp index f906ff0e9..c6b005867 100644 --- a/host/include/uhd/convert.hpp +++ b/host/include/uhd/convert.hpp @@ -1,5 +1,5 @@  // -// Copyright 2011 Ettus Research LLC +// Copyright 2011-2012 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 @@ -80,9 +80,13 @@ namespace uhd{ namespace convert{      /*!       * Get a converter factory function.       * \param id identify the conversion +     * \param prio the desired prio or -1 for best       * \return the converter factory function       */ -    UHD_API function_type get_converter(const id_type &id); +    UHD_API function_type get_converter( +        const id_type &id, +        const priority_type prio = -1 +    );      /*!       * Register the size of a particular item. diff --git a/host/include/uhd/transport/zero_copy.hpp b/host/include/uhd/transport/zero_copy.hpp index f80c738aa..1dc0e8e26 100644 --- a/host/include/uhd/transport/zero_copy.hpp +++ b/host/include/uhd/transport/zero_copy.hpp @@ -1,5 +1,5 @@  // -// Copyright 2010-2011 Ettus Research LLC +// Copyright 2010-2012 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 @@ -22,23 +22,14 @@  #include <boost/utility.hpp>  #include <boost/shared_ptr.hpp>  #include <boost/intrusive_ptr.hpp> +#include <boost/detail/atomic_count.hpp>  namespace uhd{ namespace transport{ -    //! Create smart pointer to a reusable managed buffer -    template <typename T> UHD_INLINE boost::intrusive_ptr<T> make_managed_buffer(T *p){ -        p->_ref_count = 1; //reset the count to 1 reference -        return boost::intrusive_ptr<T>(p, false); -    } - -    /*! -     * A managed receive buffer: -     * Contains a reference to transport-managed memory, -     * and a method to release the memory after reading. -     */ -    class UHD_API managed_recv_buffer{ +    //! Simple managed buffer with release interface +    class UHD_API managed_buffer{      public: -        typedef boost::intrusive_ptr<managed_recv_buffer> sptr; +        managed_buffer(void):_ref_count(0){}          /*!           * Signal to the transport that we are done with the buffer. @@ -48,84 +39,73 @@ namespace uhd{ namespace transport{          virtual void release(void) = 0;          /*! +         * Use commit() to re-write the length (for use with send buffers). +         * \param num_bytes the number of bytes written into the buffer +         */ +        UHD_INLINE void commit(size_t num_bytes){ +            _length = num_bytes; +        } + +        /*!           * Get a pointer to the underlying buffer.           * \return a pointer into memory           */ -        template <class T> inline T cast(void) const{ -            return static_cast<T>(this->get_buff()); +        template <class T> UHD_INLINE T cast(void) const{ +            return static_cast<T>(_buffer);          }          /*!           * Get the size of the underlying buffer.           * \return the number of bytes           */ -        inline size_t size(void) const{ -            return this->get_size(); +        UHD_INLINE size_t size(void) const{ +            return _length;          } -    private: -        virtual const void *get_buff(void) const = 0; -        virtual size_t get_size(void) const = 0; +        //! Create smart pointer to a reusable managed buffer +        template <typename T> UHD_INLINE boost::intrusive_ptr<T> make( +            T *p, void *buffer, size_t length +        ){ +            _buffer = buffer; +            _length = length; +            return boost::intrusive_ptr<T>(p); +        } + +        boost::detail::atomic_count _ref_count; -    public: int _ref_count; +    protected: +        void *_buffer; +        size_t _length;      }; -    UHD_INLINE void intrusive_ptr_add_ref(managed_recv_buffer *p){ +    UHD_INLINE void intrusive_ptr_add_ref(managed_buffer *p){          ++(p->_ref_count);      } -    UHD_INLINE void intrusive_ptr_release(managed_recv_buffer *p){ +    UHD_INLINE void intrusive_ptr_release(managed_buffer *p){          if (--(p->_ref_count) == 0) p->release();      }      /*! +     * A managed receive buffer: +     * Contains a reference to transport-managed memory, +     * and a method to release the memory after reading. +     */ +    class UHD_API managed_recv_buffer : public managed_buffer{ +    public: +        typedef boost::intrusive_ptr<managed_recv_buffer> sptr; +    }; + +    /*!       * A managed send buffer:       * Contains a reference to transport-managed memory,       * and a method to commit the memory after writing.       */ -    class UHD_API managed_send_buffer{ +    class UHD_API managed_send_buffer : public managed_buffer{      public:          typedef boost::intrusive_ptr<managed_send_buffer> sptr; - -        /*! -         * Signal to the transport that we are done with the buffer. -         * This should be called to commit the write to the transport object. -         * After calling, the referenced memory should be considered invalid. -         * \param num_bytes the number of bytes written into the buffer -         */ -        virtual void commit(size_t num_bytes) = 0; - -        /*! -         * Get a pointer to the underlying buffer. -         * \return a pointer into memory -         */ -        template <class T> inline T cast(void) const{ -            return static_cast<T>(this->get_buff()); -        } - -        /*! -         * Get the size of the underlying buffer. -         * \return the number of bytes -         */ -        inline size_t size(void) const{ -            return this->get_size(); -        } - -    private: -        virtual void *get_buff(void) const = 0; -        virtual size_t get_size(void) const = 0; - -    public: int _ref_count;      }; -    UHD_INLINE void intrusive_ptr_add_ref(managed_send_buffer *p){ -        ++(p->_ref_count); -    } - -    UHD_INLINE void intrusive_ptr_release(managed_send_buffer *p){ -        if (--(p->_ref_count) == 0) p->commit(0); -    } -      /*!       * A zero-copy interface for transport objects.       * Provides a way to get send and receive buffers diff --git a/host/include/uhd/usrp/mboard_eeprom.hpp b/host/include/uhd/usrp/mboard_eeprom.hpp index c47f894be..f064e9956 100644 --- a/host/include/uhd/usrp/mboard_eeprom.hpp +++ b/host/include/uhd/usrp/mboard_eeprom.hpp @@ -1,5 +1,5 @@  // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2012 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 @@ -34,30 +34,22 @@ namespace uhd{ namespace usrp{       */      struct UHD_API mboard_eeprom_t : uhd::dict<std::string, std::string>{ -        //! Possible EEPROM maps types -        enum map_type{ -            MAP_N100, -            MAP_B000, -            MAP_B100, -            MAP_E100 -        }; -          //! Make a new empty mboard eeprom          mboard_eeprom_t(void);          /*!           * Make a new mboard EEPROM handler.           * \param iface the interface to i2c -         * \param map the map type enum +         * \param which which EEPROM map to use           */ -        mboard_eeprom_t(i2c_iface &iface, map_type map); +        mboard_eeprom_t(i2c_iface &iface, const std::string &which);          /*!           * Write the contents of this object to the EEPROM.           * \param iface the interface to i2c -         * \param map the map type enum +         * \param which which EEPROM map to use           */ -        void commit(i2c_iface &iface, map_type map) const; +        void commit(i2c_iface &iface, const std::string &which) const;      }; diff --git a/host/include/uhd/usrp/multi_usrp.hpp b/host/include/uhd/usrp/multi_usrp.hpp index 88affa40c..2e83823ba 100644 --- a/host/include/uhd/usrp/multi_usrp.hpp +++ b/host/include/uhd/usrp/multi_usrp.hpp @@ -1,5 +1,5 @@  // -// Copyright 2010-2011 Ettus Research LLC +// Copyright 2010-2012 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 @@ -25,6 +25,7 @@  #define UHD_USRP_MULTI_USRP_COMMAND_TIME_API  #define UHD_USRP_MULTI_USRP_BW_RANGE_API  #define UHD_USRP_MULTI_USRP_USER_REGS_API +#define UHD_USRP_MULTI_USRP_GET_USRP_INFO_API  #include <uhd/config.hpp>  #include <uhd/device.hpp> @@ -127,6 +128,24 @@ public:          return this->get_device()->get_tx_stream(args);      } +    /*! +     * Returns identifying information about this USRP's configuration. +     * Returns motherboard ID, name, and serial. +     * Returns daughterboard RX ID, subdev name and spec, serial, and antenna. +     * \param chan channel index 0 to N-1 +     * \return RX info +     */ +    virtual dict<std::string, std::string> get_usrp_rx_info(size_t chan = 0) = 0; + +    /*! +     * Returns identifying information about this USRP's configuration. +     * Returns motherboard ID, name, and serial. +     * Returns daughterboard TX ID, subdev name and spec, serial, and antenna. +     * \param chan channel index 0 to N-1 +     * \return TX info +     */ +     virtual dict<std::string, std::string> get_usrp_tx_info(size_t chan = 0) = 0; +      /*******************************************************************       * Mboard methods       ******************************************************************/ @@ -428,6 +447,13 @@ public:      virtual freq_range_t get_rx_freq_range(size_t chan = 0) = 0;      /*! +     * Get the center frequency range of the RF frontend. +     * \param chan the channel index 0 to N-1 +     * \return a frequency range object +     */ +    virtual freq_range_t get_fe_rx_freq_range(size_t chan = 0) = 0; + +    /*!       * Set the RX gain value for the specified gain element.       * For an empty name, distribute across all gain elements.       * \param gain the gain in dB @@ -674,6 +700,13 @@ public:      virtual freq_range_t get_tx_freq_range(size_t chan = 0) = 0;      /*! +     * Get the center frequency range of the TX frontend. +     * \param chan the channel index 0 to N-1 +     * \return a frequency range object +     */ +    virtual freq_range_t get_fe_tx_freq_range(size_t chan = 0) = 0; + +    /*!       * Set the TX gain value for the specified gain element.       * For an empty name, distribute across all gain elements.       * \param gain the gain in dB diff --git a/host/include/uhd/utils/images.hpp b/host/include/uhd/utils/images.hpp index 8b5a1eedd..a0934fb08 100644 --- a/host/include/uhd/utils/images.hpp +++ b/host/include/uhd/utils/images.hpp @@ -1,5 +1,5 @@  // -// Copyright 2010 Ettus Research LLC +// Copyright 2010,2012 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 @@ -33,6 +33,21 @@ namespace uhd{       */      UHD_API std::string find_image_path(const std::string &image_name); +    /*! +     * Search for the location of the UHD Images Downloader script. +     * \return the full system path to uhd_images_downloader.py +     */ + +    UHD_API std::string find_images_downloader(void); + +    /*! +     * Return the error string for recommending using the UHD Images Downloader. +     * String depends on OS. +     * \return the message suggesting the use of uhd_images_downloader.py +     */ + +    UHD_API std::string print_images_error(void); +  } //namespace uhd  #endif /* INCLUDED_UHD_UTILS_IMAGES_HPP */ diff --git a/host/include/uhd/utils/paths.hpp b/host/include/uhd/utils/paths.hpp index 2261f1b77..f5a40b2c9 100644 --- a/host/include/uhd/utils/paths.hpp +++ b/host/include/uhd/utils/paths.hpp @@ -1,5 +1,5 @@  // -// Copyright 2011 Ettus Research LLC +// Copyright 2011-2012 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 @@ -29,6 +29,9 @@ namespace uhd{      //! Get a string representing the system's appdata directory      UHD_API std::string get_app_path(void); +    //! Get a string representing the system's pkg data directory +    UHD_API std::string get_pkg_data_path(void); +  } //namespace uhd  #endif /* INCLUDED_UHD_UTILS_PATHS_HPP */ diff --git a/host/include/uhd/version.hpp b/host/include/uhd/version.hpp index ee0c4fe43..09d0e55fd 100644 --- a/host/include/uhd/version.hpp +++ b/host/include/uhd/version.hpp @@ -27,7 +27,7 @@   * The format is oldest ABI compatible release - ABI compat number.   * The compatibility number allows pre-release ABI to be versioned.   */ -#define UHD_VERSION_ABI_STRING "3.4.0-0" +#define UHD_VERSION_ABI_STRING "3.4.0-2"  namespace uhd{  | 
