Monado OpenXR Runtime
wmr_interface.h
Go to the documentation of this file.
1// Copyright 2020-2021, N Madsen.
2// Copyright 2020-2023, Collabora, Ltd.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Interface to the WMR driver.
7 * @author nima01 <nima_zero_one@protonmail.com>
8 * @author Jakob Bornecrantz <jakob@collabora.com>
9 * @ingroup drv_wmr
10 */
11
12#pragma once
13
14#include "xrt/xrt_prober.h"
15
16#include "wmr_common.h"
17
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23
24/*!
25 * @defgroup drv_wmr Windows Mixed Reality driver
26 * @ingroup drv
27 *
28 * @brief Windows Mixed Reality driver.
29 */
30
31/*!
32 * @dir drivers/wmr
33 *
34 * @brief @ref drv_wmr files.
35 */
36
37
38/*
39 *
40 * Builder interface.
41 *
42 */
43
44/*!
45 * Results from searching for host attached Bluetooth controllers.
46 *
47 * @ingroup drv_wmr
48 */
50{
51 struct xrt_prober_device *left;
52 struct xrt_prober_device *right;
53};
54
55/*!
56 * Search for a left and right pair of Windows Mixed Reality controllers, groups
57 * them by type (Classic/Odyssey/G2). Preferring Odyssey over Classic. Will mix
58 * types in order to get a complete left and right pair if need be, but prefers
59 * matching types first. G2 currently not supported.
60 *
61 * @ingroup drv_wmr
62 */
63void
65 struct xrt_prober_device **xpdevs,
66 size_t xpdev_count,
67 enum u_logging_level log_level,
68 struct wmr_bt_controllers_search_results *out_wbtcsr);
69
70/*!
71 * Results from searching for a companion device. Doctor?
72 *
73 * @ingroup drv_wmr
74 */
76{
77 struct xrt_prober_device *xpdev_companion;
78 enum wmr_headset_type type;
79};
80
81/*!
82 * Searches for the the list of xpdevs for the companion device of a holo lens
83 * device.
84 *
85 * @ingroup drv_wmr
86 */
87void
89 struct xrt_prober_device **xpdevs,
90 size_t xpdev_count,
91 enum u_logging_level log_level,
92 struct xrt_prober_device *xpdev_holo,
93 struct wmr_companion_search_results *out_wcsr);
94
95/*!
96 * Results from searching for a headset.
97 *
98 * @ingroup drv_wmr
99 */
101{
102 struct xrt_prober_device *xpdev_holo;
103 struct xrt_prober_device *xpdev_companion;
104 enum wmr_headset_type type;
105};
106
107/*!
108 * Find a headsets.
109 *
110 * @ingroup drv_wmr
111 */
112void
114 struct xrt_prober_device **xpdevs,
115 size_t xpdev_count,
116 enum u_logging_level log_level,
117 struct wmr_headset_search_results *out_whsr);
118
119
120/*
121 *
122 * Creation extensions.
123 *
124 */
125
126/*!
127 * Creates a WMR headset with the given devices and of headset type.
128 *
129 * @ingroup drv_wmr
130 */
133 struct xrt_prober_device *xpdev_holo,
134 struct xrt_prober_device *xpdev_companion,
135 enum wmr_headset_type type,
136 enum u_logging_level log_level,
137 struct xrt_device **out_hmd,
138 struct xrt_device **out_left,
139 struct xrt_device **out_right,
140 struct xrt_device **out_ht_left,
141 struct xrt_device **out_ht_right);
142
143/*!
144 * Creates a WMR BT controller device.
145 *
146 * @ingroup drv_wmr
147 */
150 struct xrt_prober_device *xpdev,
151 enum u_logging_level log_level,
152 struct xrt_device **out_xdev);
153
154
155#ifdef __cplusplus
156}
157#endif
u_logging_level
Logging level enum.
Definition: u_logging.h:40
xrt_result_t wmr_create_bt_controller(struct xrt_prober *xp, struct xrt_prober_device *xpdev, enum u_logging_level log_level, struct xrt_device **out_xdev)
Creates a WMR BT controller device.
Definition: wmr_prober.c:397
void wmr_find_headset(struct xrt_prober *xp, struct xrt_prober_device **xpdevs, size_t xpdev_count, enum u_logging_level log_level, struct wmr_headset_search_results *out_whsr)
Find a headsets.
Definition: wmr_prober.c:275
wmr_headset_type
Headset type, used to select different control and init/shutdown procedures.
Definition: wmr_common.h:29
void wmr_find_bt_controller_pair(struct xrt_prober *xp, struct xrt_prober_device **xpdevs, size_t xpdev_count, enum u_logging_level log_level, struct wmr_bt_controllers_search_results *out_wbtcsr)
Search for a left and right pair of Windows Mixed Reality controllers, groups them by type (Classic/O...
Definition: wmr_prober.c:195
xrt_result_t wmr_create_headset(struct xrt_prober *xp, struct xrt_prober_device *xpdev_holo, struct xrt_prober_device *xpdev_companion, enum wmr_headset_type type, enum u_logging_level log_level, struct xrt_device **out_hmd, struct xrt_device **out_left, struct xrt_device **out_right, struct xrt_device **out_ht_left, struct xrt_device **out_ht_right)
Creates a WMR headset with the given devices and of headset type.
Definition: wmr_prober.c:328
void wmr_find_companion_device(struct xrt_prober *xp, struct xrt_prober_device **xpdevs, size_t xpdev_count, enum u_logging_level log_level, struct xrt_prober_device *xpdev_holo, struct wmr_companion_search_results *out_wcsr)
Searches for the the list of xpdevs for the companion device of a holo lens device.
Definition: wmr_prober.c:255
enum xrt_result xrt_result_t
Result type used across Monado.
Results from searching for host attached Bluetooth controllers.
Definition: wmr_interface.h:50
Results from searching for a companion device.
Definition: wmr_interface.h:76
Results from searching for a headset.
Definition: wmr_interface.h:101
A single HMD or input device.
Definition: xrt_device.h:241
A probed device, may or may not be opened.
Definition: xrt_prober.h:85
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition: xrt_prober.h:132
Defines and constants related to WMR driver code.
Common interface to probe for devices.