30#define WMR_FEATURE_BUFFER_SIZE 497
31#define WMR_MS_HOLOLENS_NS_PER_TICK 100
34#define WMR_MS_HOLOLENS_MSG_SENSORS 0x01
35#define WMR_MS_HOLOLENS_MSG_CONTROL 0x02
36#define WMR_MS_HOLOLENS_MSG_DEBUG 0x03
37#define WMR_MS_HOLOLENS_MSG_BT_IFACE 0x05
38#define WMR_MS_HOLOLENS_MSG_LEFT_CONTROLLER 0x06
39#define WMR_MS_HOLOLENS_MSG_RIGHT_CONTROLLER 0x0E
40#define WMR_MS_HOLOLENS_MSG_BT_CONTROL 0x16
41#define WMR_MS_HOLOLENS_MSG_CONTROLLER_STATUS 0x17
44#define WMR_CONTROL_MSG_IPD_VALUE 0x01
45#define WMR_CONTROL_MSG_UNKNOWN_02 0x02
46#define WMR_CONTROL_MSG_DEVICE_STATUS 0x05
49#define WMR_BT_IFACE_MSG_DEBUG 0x19
52#define WMR_CONTROLLER_STATUS_UNPAIRED 0x0
53#define WMR_CONTROLLER_STATUS_OFFLINE 0x1
54#define WMR_CONTROLLER_STATUS_ONLINE 0x2
57enum wmr_bt_control_msg
59 WMR_BT_CONTROL_MSG_ONLINE_STATUS = 0x04,
60 WMR_BT_CONTROL_MSG_PAIR = 0x05,
61 WMR_BT_CONTROL_MSG_UNPAIR = 0x06,
62 WMR_BT_CONTROL_MSG_PAIRING_STATUS = 0x08,
63 WMR_BT_CONTROL_MSG_CMD_STATUS = 0x09,
66#define STR_TO_U32(s) ((uint32_t)(((s)[0]) | ((s)[1] << 8) | ((s)[2] << 16) | ((s)[3] << 24)))
67#define WMR_MAGIC STR_TO_U32("Dlo+")
69#define WMR_MIN_EXPOSURE 60
70#define WMR_MAX_OBSERVED_EXPOSURE 6000
71#define WMR_MAX_EXPOSURE 9000
72#define WMR_MIN_GAIN 16
73#define WMR_MAX_GAIN 255
75static const unsigned char hololens_sensors_imu_on[64] = {0x02, 0x07};
81 uint16_t temperature[4];
82 uint64_t gyro_timestamp[4];
83 int16_t gyro[3][4 * 8];
84 uint64_t accel_timestamp[4];
86 uint64_t video_timestamp[4];
93 char manufacturer[0x40];
100 char revision_date[0x20];
116vec3_from_hololens_accel(int32_t sample[3][4],
int i,
struct xrt_vec3 *out_vec);
119vec3_from_hololens_gyro(int16_t sample[3][32],
int i,
struct xrt_vec3 *out_vec);
123read8(
const unsigned char **buffer)
125 uint8_t ret = **buffer;
131read16(
const unsigned char **buffer)
133 int16_t ret = (*(*buffer + 0) << 0) |
134 (*(*buffer + 1) << 8);
140read24(
const unsigned char **buffer)
143 int32_t ret = (*(*buffer + 0) << 8) | (*(*buffer + 1) << 16) | (*(*buffer + 2) << 24);
151read32(
const unsigned char **buffer)
153 int32_t ret = (*(*buffer + 0) << 0) |
154 (*(*buffer + 1) << 8) |
155 (*(*buffer + 2) << 16) |
156 (*(*buffer + 3) << 24);
161static inline uint64_t
162read64(
const unsigned char **buffer)
164 uint64_t ret = ((uint64_t) * (*buffer + 0) << 0) |
165 ((uint64_t) * (*buffer + 1) << 8) |
166 ((uint64_t) * (*buffer + 2) << 16) |
167 ((uint64_t) * (*buffer + 3) << 24) |
168 ((uint64_t) * (*buffer + 4) << 32) |
169 ((uint64_t) * (*buffer + 5) << 40) |
170 ((uint64_t) * (*buffer + 6) << 48) |
171 ((uint64_t) * (*buffer + 7) << 56);
Definition: wmr_protocol.h:79
A 3 element vector with single floats.
Definition: xrt_defines.h:271