Monado OpenXR Runtime
Loading...
Searching...
No Matches
rift_interface.h
Go to the documentation of this file.
1// Copyright 2025, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Interface to Oculus Rift driver code.
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup drv_rift
8 */
9
10#pragma once
11
12#include "xrt/xrt_device.h"
13#include "xrt/xrt_defines.h"
14#include "xrt/xrt_prober.h"
15
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21
22struct rift_hmd;
23
24enum rift_variant
25{
26 RIFT_VARIANT_DK1,
27 RIFT_VARIANT_DK2,
28 RIFT_VARIANT_CV1,
29};
30
31#define OCULUS_VR_VID 0x2833
32
33#define OCULUS_DK2_PID 0x0021
34#define OCULUS_CV1_PID 0x0031
35
36#define RIFT_DK2_PRODUCT_STRING "Rift DK2"
37#define RIFT_CV1_PRODUCT_STRING "Rift CV1"
38
39/*!
40 * Checks whether the given device is an Oculus device, by checking the manufacturer string.
41 *
42 * @ingroup drv_rift
43 * @param xp The prober to use for getting string descriptors.
44 * @param dev The device to check.
45 * @return true if the device is an Oculus device, false otherwise.
46 */
47bool
48rift_is_oculus(struct xrt_prober *xp, struct xrt_prober_device *dev);
49
50/*!
51 * Probing function for Oculus Rift devices.
52 *
53 * @ingroup drv_rift
54 * @see xrt_prober_found_func_t
55 */
56int
57rift_found(struct xrt_prober *xp,
58 struct xrt_prober_device **devices,
59 size_t device_count,
60 size_t index,
61 cJSON *attached_data,
62 struct xrt_device **out_xdev);
63
64int
65rift_devices_create(struct os_hid_device *hmd_dev,
66 struct os_hid_device *radio_dev,
67 enum rift_variant variant,
68 const char *serial_number,
69 struct rift_hmd **out_hmd,
70 struct xrt_device **out_xdevs);
71
72/*!
73 * @dir drivers/rift
74 *
75 * @brief @ref drv_rift files.
76 */
77
78#ifdef __cplusplus
79}
80#endif
int rift_found(struct xrt_prober *xp, struct xrt_prober_device **devices, size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev)
Probing function for Oculus Rift devices.
Definition rift_prober.c:38
bool rift_is_oculus(struct xrt_prober *xp, struct xrt_prober_device *dev)
Checks whether the given device is an Oculus device, by checking the manufacturer string.
Definition rift_prober.c:19
Representing a single hid interface on a device.
Definition os_hid.h:29
A rift HMD device.
Definition rift_internal.h:788
A single HMD or input device.
Definition xrt_device.h:310
A probed device, may or may not be opened.
Definition xrt_prober.h:86
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition xrt_prober.h:133
Common defines and enums for XRT.
Header defining an xrt display or controller device.
Common interface to probe for devices.