device-libusb.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "messenger-libusb.h"
7 
8 namespace librealsense
9 {
10  namespace platform
11  {
12  class usb_device_libusb : public usb_device, public std::enable_shared_from_this<usb_device_libusb>
13  {
14  public:
15  usb_device_libusb(libusb_device* device, const libusb_device_descriptor& desc, const usb_device_info& info, std::shared_ptr<usb_context> context);
16  virtual ~usb_device_libusb();
17 
18  virtual const usb_device_info get_info() const override { return _info; }
19  virtual const std::vector<rs_usb_interface> get_interfaces() const override { return _interfaces; }
20  virtual const rs_usb_interface get_interface(uint8_t interface_number) const override;
21  virtual const rs_usb_messenger open(uint8_t interface_number) override;
22  virtual const std::vector<usb_descriptor> get_descriptors() const override { return _descriptors; }
23  libusb_device* get_device() { return _device; }
24 
25  private:
26  libusb_device* _device;
27  libusb_device_descriptor _usb_device_descriptor;
29  std::vector<std::shared_ptr<usb_interface>> _interfaces;
30  std::vector<usb_descriptor> _descriptors;
31  std::shared_ptr<usb_context> _context;
32 
33  std::shared_ptr<handle_libusb> get_handle(uint8_t interface_number);
34  };
35  }
36 }
std::vector< std::shared_ptr< usb_interface > > _interfaces
Definition: device-libusb.h:29
std::shared_ptr< usb_interface > rs_usb_interface
Definition: usb-interface.h:31
std::shared_ptr< handle_libusb > get_handle(uint8_t interface_number)
usb_device_libusb(libusb_device *device, const libusb_device_descriptor &desc, const usb_device_info &info, std::shared_ptr< usb_context > context)
virtual const rs_usb_messenger open(uint8_t interface_number) override
unsigned char uint8_t
Definition: stdint.h:78
libusb_device_descriptor _usb_device_descriptor
Definition: device-libusb.h:27
def info(name, value, persistent=False)
Definition: test.py:301
virtual const rs_usb_interface get_interface(uint8_t interface_number) const override
std::shared_ptr< usb_messenger > rs_usb_messenger
Definition: usb-messenger.h:26
virtual const usb_device_info get_info() const override
Definition: device-libusb.h:18
virtual const std::vector< rs_usb_interface > get_interfaces() const override
Definition: device-libusb.h:19
virtual const std::vector< usb_descriptor > get_descriptors() const override
Definition: device-libusb.h:22
std::shared_ptr< usb_context > _context
Definition: device-libusb.h:31
std::vector< usb_descriptor > _descriptors
Definition: device-libusb.h:30


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12