Monado OpenXR Runtime
r_internal.h
Go to the documentation of this file.
1// Copyright 2020-2022, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Internal stuff in remote driver.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup drv_remote
8 */
9
10#pragma once
11
12#include "r_interface.h"
13
14#include "xrt/xrt_device.h"
15#include "xrt/xrt_system.h"
16#include "xrt/xrt_tracking.h"
17
18#include "os/os_threading.h"
19
21
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*!
28 * Central object remote object.
29 *
30 * @ingroup drv_remote
31 */
32struct r_hub
33{
34 // System devices wrapper.
35 struct xrt_system_devices base;
36
37 //! Origin for all locations.
39
40 //! Connection to the controller.
42
43 //! The data that the is the reset position.
45
46 //! The latest data received.
48
49 //! Incoming connection socket.
51
52 uint16_t port;
53 uint32_t view_count;
54
55 struct os_thread_helper oth;
56
57 //! Index to the left controller.
58 int32_t left_index;
59
60 //! Index to the right controller.
61 int32_t right_index;
62
63 struct
64 {
65 bool hmd, left, right;
66 } gui;
67};
68
69/*!
70 * HMD
71 *
72 * @ingroup drv_remote
73 */
74struct r_hmd
75{
76 struct xrt_device base;
77
78 struct r_hub *r;
79};
80
81/*!
82 * Device
83 *
84 * @ingroup drv_remote
85 */
87{
88 struct xrt_device base;
89
90 struct r_hub *r;
91
92 struct u_hand_tracking hand_tracking;
93
94 bool is_left;
95};
96
97
98struct xrt_device *
99r_hmd_create(struct r_hub *r);
100
101struct xrt_device *
102r_device_create(struct r_hub *r, bool is_left);
103
104
105#ifdef __cplusplus
106}
107#endif
Wrapper around OS threading native functions.
Interface to remote driver.
int r_socket_t
The type for a socket descriptor.
Definition: r_interface.h:61
All in one helper that handles locking, waiting for change and starting a thread.
Definition: os_threading.h:453
Device.
Definition: r_internal.h:87
HMD.
Definition: r_internal.h:75
Central object remote object.
Definition: r_internal.h:33
struct r_remote_data reset
The data that the is the reset position.
Definition: r_internal.h:44
int32_t right_index
Index to the right controller.
Definition: r_internal.h:61
r_socket_t accept_fd
Incoming connection socket.
Definition: r_internal.h:50
int32_t left_index
Index to the left controller.
Definition: r_internal.h:58
struct xrt_tracking_origin origin
Origin for all locations.
Definition: r_internal.h:38
struct r_remote_connection rc
Connection to the controller.
Definition: r_internal.h:41
struct r_remote_data latest
The latest data received.
Definition: r_internal.h:47
Shared connection.
Definition: r_interface.h:153
Remote data sent from the debugger to the hub.
Definition: r_interface.h:139
Main struct drivers can use to implement hand and finger tracking.
Definition: u_hand_tracking.h:93
A single HMD or input device.
Definition: xrt_device.h:230
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition: xrt_system.h:218
A tracking system or device origin.
Definition: xrt_tracking.h:71
Hand Tracking API interface.
Header defining an xrt display or controller device.
Header for system objects.
Header defining the tracking system integration in Monado.