Monado OpenXR Runtime
rift_s_radio.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Jan Schmidt
3 * SPDX-License-Identifier: BSL-1.0
4 *
5 * OpenHMD - Free and Open Source API and drivers for immersive technology.
6 *
7 * The Rift S talks to remote devices via HID radio control reports
8 * the need to be serialised and coordinated to work properly.
9 *
10 */
11/*!
12 * @file
13 * @brief Oculus Rift S HMD Radio management interface
14 *
15 * Functions for serialising requests to communicate with
16 * Touch controllers over the HMDs wireless radio link,
17 * collecting responses and delivering them back via callbacks.
18 *
19 * Ported from OpenHMD
20 *
21 * @author Jan Schmidt <jan@centricular.com>
22 */
23
24#pragma once
25
26#ifndef RIFT_S_RADIO_H
27#define RIFT_S_RADIO_H
28
29#include "os/os_hid.h"
30#include "xrt/xrt_defines.h"
31
34
35typedef void (*rift_s_radio_completion_fn)(bool success,
36 uint8_t *response_bytes,
37 int response_bytes_len,
38 void *cb_data);
39
41{
42 bool command_result_pending;
43 int last_radio_seqnum;
44
45 rift_s_radio_command *pending_commands;
46 rift_s_radio_command *pending_commands_tail;
47};
48
49void
50rift_s_radio_state_init(rift_s_radio_state *state);
51void
52rift_s_radio_state_clear(rift_s_radio_state *state);
53
54void
55rift_s_radio_update(rift_s_radio_state *state, struct os_hid_device *hid);
56void
57rift_s_radio_queue_command(rift_s_radio_state *state,
58 const uint64_t device_id,
59 const uint8_t *cmd_bytes,
60 const int cmd_bytes_len,
61 rift_s_radio_completion_fn cb,
62 void *cb_data);
63void
64rift_s_radio_get_json_block(rift_s_radio_state *state,
65 const uint64_t device_id,
66 rift_s_radio_completion_fn cb,
67 void *cb_data);
68#endif
Wrapper around OS native hid functions.
Representing a single hid interface on a device.
Definition: os_hid.h:29
Definition: rift_s_radio.c:32
Definition: rift_s_radio.h:41
Common defines and enums for XRT.