Statistics
| Branch: | Tag: | Revision:

root / host / include / uhd / transport / usb_device_handle.hpp @ 687e118e

History | View | Annotate | Download (2.6 kB)

1
//
2
// Copyright 2010 Ettus Research LLC
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
//
17

    
18
#ifndef INCLUDED_UHD_TRANSPORT_USB_DEVICE_HANDLE_HPP
19
#define INCLUDED_UHD_TRANSPORT_USB_DEVICE_HANDLE_HPP
20

    
21
#include <uhd/config.hpp>
22
#include <boost/utility.hpp>
23
#include <boost/shared_ptr.hpp>
24
#include <boost/cstdint.hpp>
25
#include <vector>
26

    
27
namespace uhd { namespace transport {
28

    
29
/*!
30
 * Device handle class that represents a USB device
31
 * Used for identifying devices on the USB bus and selecting which device is
32
 * used when creating a  USB transport. A minimal subset of USB descriptor
33
 * fields are used. Fields can be found in the USB 2.0 specification Table
34
 * 9-8 (Standard Device Descriptor). In addition to fields of the device
35
 * descriptor, the interface returns the device's USB device address.
36
 *
37
 * Note: The USB 2.0 Standard Device Descriptor contains an index rather then
38
 *       a true descriptor serial number string. This interface returns the
39
 *       actual string descriptor.
40
 */
41
class UHD_API usb_device_handle : boost::noncopyable {
42
public:
43
    typedef boost::shared_ptr<usb_device_handle> sptr;
44

    
45
    /*!
46
     * Return the device's serial number 
47
     * \return a string describing the device's serial number
48
     */
49
    virtual UHD_API std::string get_serial() const = 0;
50

    
51
    /*!
52
     * Return the device's Vendor ID (usually assigned by the USB-IF)
53
     * \return a Vendor ID
54
     */
55
    virtual UHD_API boost::uint16_t get_vendor_id() const = 0;
56

    
57
    /*!
58
     * Return the device's Product ID (usually assigned by manufacturer)
59
     * \return a Product ID
60
     */
61
    virtual UHD_API boost::uint16_t get_product_id() const = 0;
62

    
63
    /*!
64
     * Return the device's USB address
65
     * \return a Product ID
66
     */
67
    virtual UHD_API boost::uint16_t get_device_addr() const = 0;
68

    
69
    /*!
70
     * Return a vector of USB devices on this host 
71
     * \return a vector of USB device handles
72
     */
73
    static UHD_API std::vector<usb_device_handle::sptr> get_device_list();
74

    
75
}; //namespace usb
76

    
77
}} //namespace
78

    
79
#endif /* INCLUDED_UHD_TRANSPORT_USB_DEVICE_HANDLE_HPP */