Monado OpenXR Runtime
Loading...
Searching...
No Matches
u_builder_search.h
Go to the documentation of this file.
1// Copyright 2022-2023, Collabora, Ltd.
2// Copyright 2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Prober device search helpers for @ref xrt_builder implementations.
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @ingroup aux_util
9 */
10
11#pragma once
12
13#include "xrt/xrt_compiler.h"
14
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20struct xrt_prober;
22
23/*!
24 * Max return of the number @ref xrt_prober_device.
25 *
26 * @ingroup aux_util
27 */
28#define U_BUILDER_SEARCH_MAX (16) // 16 Vive trackers
29
30/*!
31 * A filter to match the against.
32 *
33 * @ingroup aux_util
34 */
36{
37 uint16_t vendor_id;
38 uint16_t product_id;
39 enum xrt_bus_type bus_type;
40};
41
42/*!
43 * Results of a search of devices.
44 *
45 * @ingroup aux_util
46 */
48{
49 //! Out field of found @ref xrt_prober_device.
51
52 //! Number of found devices.
54};
55
56/*!
57 * Find the first @ref xrt_prober_device in the prober list.
58 *
59 * @ingroup aux_util
60 */
61struct xrt_prober_device *
63 size_t xpdev_count,
64 uint16_t vendor_id,
65 uint16_t product_id,
66 enum xrt_bus_type bus_type);
67
68/*!
69 * Find all of the @ref xrt_prober_device that matches any in the given list of
70 * @ref u_builder_search_filter filters.
71 *
72 * @ingroup aux_util
73 */
74void
76 struct xrt_prober_device *const *xpdevs,
77 size_t xpdev_count,
78 const struct u_builder_search_filter *filters,
79 size_t filter_count,
80 struct u_builder_search_results *results);
81
82#ifdef __cplusplus
83}
84#endif
#define U_BUILDER_SEARCH_MAX
Max return of the number xrt_prober_device.
Definition u_builder_search.h:28
void u_builder_search(struct xrt_prober *xp, struct xrt_prober_device *const *xpdevs, size_t xpdev_count, const struct u_builder_search_filter *filters, size_t filter_count, struct u_builder_search_results *results)
Find all of the xrt_prober_device that matches any in the given list of u_builder_search_filter filte...
Definition u_builder_search.c:40
struct xrt_prober_device * u_builder_find_prober_device(struct xrt_prober_device *const *xpdevs, size_t xpdev_count, uint16_t vendor_id, uint16_t product_id, enum xrt_bus_type bus_type)
Find the first xrt_prober_device in the prober list.
Definition u_builder_search.c:19
A filter to match the against.
Definition u_builder_search.h:36
Results of a search of devices.
Definition u_builder_search.h:48
struct xrt_prober_device * xpdevs[(16)]
Out field of found xrt_prober_device.
Definition u_builder_search.h:50
size_t xpdev_count
Number of found devices.
Definition u_builder_search.h:53
A probed device, may or may not be opened.
Definition xrt_prober.h:88
uint16_t product_id
USB/Bluetooth product ID (PID)
Definition xrt_prober.h:97
uint16_t vendor_id
USB/Bluetooth vendor ID (VID)
Definition xrt_prober.h:92
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition xrt_prober.h:135
Header holding common defines.
xrt_bus_type
Bus type of a device.
Definition xrt_prober.h:66