Monado OpenXR Runtime
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 * Probing function for Oculus Rift devices.
41 *
42 * @ingroup drv_rift
43 * @see xrt_prober_found_func_t
44 */
45int
46rift_found(struct xrt_prober *xp,
47 struct xrt_prober_device **devices,
48 size_t device_count,
49 size_t index,
50 cJSON *attached_data,
51 struct xrt_device **out_xdev);
52
53int
54rift_devices_create(struct os_hid_device *dev,
55 enum rift_variant variant,
56 const char *device_name,
57 const char *serial_number,
58 struct rift_hmd **out_hmd,
59 struct xrt_device **out_xdevs);
60
61/*!
62 * @dir drivers/rift
63 *
64 * @brief @ref drv_rift files.
65 */
66
67#ifdef __cplusplus
68}
69#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:19
Representing a single hid interface on a device.
Definition: os_hid.h:29
A rift HMD device.
Definition: rift_internal.h:431
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.