The open source OpenXR runtime
at main 157 lines 3.7 kB view raw
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 */ 49struct wmr_bt_controllers_search_results 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 64wmr_find_bt_controller_pair(struct xrt_prober *xp, 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 */ 75struct wmr_companion_search_results 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 88wmr_find_companion_device(struct xrt_prober *xp, 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 */ 100struct wmr_headset_search_results 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 113wmr_find_headset(struct xrt_prober *xp, 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 */ 131xrt_result_t 132wmr_create_headset(struct xrt_prober *xp, 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 */ 148xrt_result_t 149wmr_create_bt_controller(struct xrt_prober *xp, 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