Monado OpenXR Runtime
wmr_controller_connection Struct Reference

A connection for communicating with the controller. More...

#include <wmr/wmr_controller_base.h>

Inheritance diagram for wmr_controller_connection:
Collaboration diagram for wmr_controller_connection:

Data Fields

struct wmr_controller_basewcb
 The controller this connection is talking to. More...
 
bool(* send_bytes )(struct wmr_controller_connection *wcc, const uint8_t *buffer, uint32_t buf_size)
 
void(* receive_bytes )(struct wmr_controller_connection *wcc, uint64_t time_ns, uint8_t *buffer, uint32_t buf_size)
 
int(* read_sync )(struct wmr_controller_connection *wcc, uint8_t *buffer, uint32_t buf_size, int timeout_ms)
 
void(* disconnect )(struct wmr_controller_connection *wcc)
 

Detailed Description

A connection for communicating with the controller.

The mechanism is implementation specific, so there are two variants for either communicating directly with a controller via bluetooth, and another for talking to a controller through a headset tunnelled mapping.

The controller implementation doesn't need to care how the communication is implemented.

The HMD-tunnelled version of the connection is reference counted and mutex protected, as both the controller and the HMD need to hold a reference to it to clean up safely. For bluetooth controllers, destruction of the controller xrt_device calls disconnect and destroys the connection object (and bluetooth listener) immediately.

Field Documentation

◆ wcb

struct wmr_controller_base* wmr_controller_connection::wcb

The controller this connection is talking to.


The documentation for this struct was generated from the following file: