Monado OpenXR Runtime
wmr_bt_controller.h
Go to the documentation of this file.
1// Copyright 2020-2021, N Madsen.
2// Copyright 2020-2021, Collabora, Ltd.
3// Copyright 2020-2023, Jan Schmidt
4// SPDX-License-Identifier: BSL-1.0
5/*!
6 * @file
7 * @brief Driver interface for Bluetooth based WMR motion controllers.
8 * @author Nis Madsen <nima_zero_one@protonmail.com>
9 * @ingroup drv_wmr
10 */
11#pragma once
12
13#include "os/os_threading.h"
14#include "util/u_logging.h"
15
16#include "wmr_controller_base.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23/*!
24 * A connection to a Bluetooth connected WMR Controller device
25 *
26 * @ingroup drv_wmr
27 * @implements wmr_controller_connection
28 */
30{
31 struct wmr_controller_connection base;
32
33 enum u_logging_level log_level;
34
35 struct os_hid_device *controller_hid;
36 struct os_thread_helper controller_thread;
37
38 struct os_mutex hid_lock;
39};
40
41struct xrt_device *
42wmr_bt_controller_create(struct os_hid_device *controller_hid,
43 enum xrt_device_type controller_type,
44 uint16_t vid,
45 uint16_t pid,
46 enum u_logging_level log_level);
47
48#ifdef __cplusplus
49}
50#endif
u_logging_level
Logging level enum.
Definition: u_logging.h:43
xrt_device_type
How an xrt_device can be used.
Definition: xrt_defines.h:786
Wrapper around OS threading native functions.
Representing a single hid interface on a device.
Definition: os_hid.h:29
A wrapper around a native mutex.
Definition: os_threading.h:55
All in one helper that handles locking, waiting for change and starting a thread.
Definition: os_threading.h:453
A connection to a Bluetooth connected WMR Controller device.
Definition: wmr_bt_controller.h:30
A connection for communicating with the controller.
Definition: wmr_controller_base.h:49
A single HMD or input device.
Definition: xrt_device.h:241
Basic logging functionality.
Common implementation for WMR controllers, handling shared behaviour such as communication,...