hid-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 
11 #define HID_REPORT_TYPE_INPUT 1
12 #define HID_REPORT_TYPE_FEATURE 3
13 
14 #define DEVICE_POWER_D0 2
15 #define DEVICE_POWER_D4 6
16 
17 #define REPORT_ID_ACCELEROMETER_3D 1
18 #define REPORT_ID_GYROMETER_3D 2
19 #define REPORT_ID_CUSTOM 3
20 
21 const size_t SIZE_OF_HID_IMU_FRAME = 32;
22 
23 static std::string gyro = "gyro_3d";
24 static std::string accel = "accel_3d";
25 static std::string custom = "custom";
26 
27 namespace librealsense
28 {
29  namespace platform
30  {
34  };
35 
43  };
44 
45  #pragma pack(push, 1)
47  unsigned char reportId;
48  unsigned char connectionType;
49  unsigned char sensorState;
50  unsigned char power;
51  unsigned char minReport;
52  unsigned short report;
53  unsigned short unknown;
54  };
55 
57  unsigned char reportId;
58  unsigned char unknown;
59  unsigned long long timeStamp;
60  short x;
61  short y;
62  short z;
63  unsigned int customValue1;
64  unsigned int customValue2;
65  unsigned short customValue3;
66  unsigned short customValue4;
67  unsigned short customValue5;
68  unsigned char customValue6;
69  unsigned char customValue7;
70  };
71 
72 #pragma pack(pop)
73  static_assert(sizeof(REALSENSE_HID_REPORT) == SIZE_OF_HID_IMU_FRAME, "HID IMU Frame struct expected size is 32 bytes");
74 
76  {
83 
84  operator std::string()
85  {
86  std::stringstream s;
87  s << "id- " << id <<
88  "\nvid- " << std::hex << vid <<
89  "\npid- " << std::hex << pid <<
90  "\nunique_id- " << unique_id <<
91  "\npath- " << device_path;
92 
93  return s.str();
94  }
95  };
96 
97  inline bool operator==(const hid_device_info& a,
98  const hid_device_info& b)
99  {
100  return (a.id == b.id) &&
101  (a.vid == b.vid) &&
102  (a.pid == b.pid) &&
103  (a.unique_id == b.unique_id) &&
104  (a.device_path == b.device_path);
105  }
106 
107 #pragma pack(push, 1)
109  {
110  unsigned char reportId;
111  unsigned char connectionType;
112  unsigned char sensorState;
113  unsigned char power;
114  unsigned char minReport;
115  unsigned short report;
116  unsigned short unknown;
117  };
118 #pragma pack(pop)
119  }
120 }
const size_t SIZE_OF_HID_IMU_FRAME
Definition: hid-types.h:21
GLboolean GLboolean GLboolean b
GLdouble s
GLsizei const GLchar *const * string
GLboolean GLboolean GLboolean GLboolean a
static std::string accel
Definition: hid-types.h:24
static std::string custom
Definition: hid-types.h:25
static std::string gyro
Definition: hid-types.h:23
bool operator==(const stream_profile &a, const stream_profile &b)
Definition: backend.h:138


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