usb-types.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 <stdint.h>
7 #include <sstream>
8 #include <string>
9 #include <map>
10 #include <vector>
11 
12 #define USB_DT_DEVICE 0x01
13 #define USB_DT_CONFIG 0x02
14 #define USB_DT_STRING 0x03
15 #define USB_DT_INTERFACE 0x04
16 #define USB_DT_ENDPOINT 0x05
17 #define USB_DT_DEVICE_QUALIFIER 0x06
18 #define USB_DT_OTHER_SPEED_CONFIG 0x07
19 #define USB_DT_INTERFACE_POWER 0x08
20 #define USB_DT_OTG 0x09
21 #define USB_DT_DEBUG 0x0a
22 #define USB_DT_INTERFACE_ASSOCIATION 0x0b
23 #define USB_DT_SECURITY 0x0c
24 #define USB_DT_KEY 0x0d
25 #define USB_DT_ENCRYPTION_TYPE 0x0e
26 #define USB_DT_BOS 0x0f
27 #define USB_DT_DEVICE_CAPABILITY 0x10
28 #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
29 #define USB_DT_WIRE_ADAPTER 0x21
30 #define USB_DT_RPIPE 0x22
31 #define USB_DT_CS_RADIO_CONTROL 0x23
32 #define USB_DT_PIPE_USAGE 0x24
33 #define USB_DT_SS_ENDPOINT_COMP 0x30
34 #define USB_DT_SSP_ISOC_ENDPOINT_COMP 0x31
35 #define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE)
36 #define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG)
37 #define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING)
38 #define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE)
39 #define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT)
40 
41 const uint16_t VID_INTEL_CAMERA = 0x8086;
42 
43 namespace librealsense
44 {
45  namespace platform
46  {
47  typedef enum _usb_status
48  {
63  } usb_status;
64 
65  typedef enum _endpoint_direction
66  {
70 
71  typedef enum _endpoint_type
72  {
77  } endpoint_type;
78 
79  //https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/supported-usb-classes#microsoft-provided-usb-device-class-drivers
80  typedef enum _usb_class
81  {
103  } usb_class;
104 
105  typedef enum _usb_subclass
106  {
109  } usb_subclass;
110 
111  // Binary-coded decimal represent the USB specification to which the UVC device complies
114  usb1_type = 0x0100,
115  usb1_1_type = 0x0110,
116  usb2_type = 0x0200,
117  usb2_01_type = 0x0201,
118  usb2_1_type = 0x0210,
119  usb3_type = 0x0300,
120  usb3_1_type = 0x0310,
121  usb3_2_type = 0x0320,
122  };
123 
124  static const std::map<usb_spec, std::string> usb_spec_names = {
125  { usb_undefined,"Undefined" },
126  { usb1_type, "1.0" },
127  { usb1_1_type, "1.1" },
128  { usb2_type, "2.0" },
129  { usb2_01_type, "2.01" },
130  { usb2_1_type, "2.1" },
131  { usb3_type, "3.0" },
132  { usb3_1_type, "3.1" },
133  { usb3_2_type, "3.2" }
134  };
135 
137  {
139 
147 
148  operator std::string()
149  {
150  std::stringstream s;
151 
152  s << "vid- " << std::hex << vid <<
153  "\npid- " << std::hex << pid <<
154  "\nmi- " << mi <<
155  "\nsusb specification- " << std::hex << (uint16_t)conn_spec << std::dec <<
156  "\nunique_id- " << unique_id;
157 
158  return s.str();
159  }
160  };
161 
162  static std::map<usb_status,std::string> usb_status_to_string =
163  {
164  {RS2_USB_STATUS_SUCCESS, "RS2_USB_STATUS_SUCCESS"},
165  {RS2_USB_STATUS_IO, "RS2_USB_STATUS_IO"},
166  {RS2_USB_STATUS_INVALID_PARAM, "RS2_USB_STATUS_INVALID_PARAM"},
167  {RS2_USB_STATUS_ACCESS, "RS2_USB_STATUS_ACCESS"},
168  {RS2_USB_STATUS_NO_DEVICE, "RS2_USB_STATUS_NO_DEVICE"},
169  {RS2_USB_STATUS_NOT_FOUND, "RS2_USB_STATUS_NOT_FOUND"},
170  {RS2_USB_STATUS_BUSY, "RS2_USB_STATUS_BUSY"},
171  {RS2_USB_STATUS_TIMEOUT, "RS2_USB_STATUS_TIMEOUT"},
172  {RS2_USB_STATUS_OVERFLOW, "RS2_USB_STATUS_OVERFLOW"},
173  {RS2_USB_STATUS_PIPE, "RS2_USB_STATUS_PIPE"},
174  {RS2_USB_STATUS_INTERRUPTED, "RS2_USB_STATUS_INTERRUPTED"},
175  {RS2_USB_STATUS_NO_MEM, "RS2_USB_STATUS_NO_MEM"},
176  {RS2_USB_STATUS_NOT_SUPPORTED, "RS2_USB_STATUS_NOT_SUPPORTED"},
177  {RS2_USB_STATUS_OTHER, "RS2_USB_STATUS_OTHER"}
178  };
179 
189  };
190 
201  };
202 
204  {
207  std::vector<uint8_t> data;
208  };
209  }
210 }
GLdouble s
enum librealsense::platform::_usb_class usb_class
const uint16_t VID_INTEL_CAMERA
Definition: usb-types.h:41
unsigned short uint16_t
Definition: stdint.h:79
static const std::map< usb_spec, std::string > usb_spec_names
Definition: usb-types.h:124
GLsizei const GLchar *const * string
unsigned char uint8_t
Definition: stdint.h:78
enum librealsense::platform::_usb_status usb_status
enum librealsense::platform::_endpoint_direction endpoint_direction
static std::map< usb_status, std::string > usb_status_to_string
Definition: usb-types.h:162
enum librealsense::platform::_usb_subclass usb_subclass
enum librealsense::platform::_endpoint_type endpoint_type


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