Monado OpenXR Runtime
xrt_prober.h File Reference

Common interface to probe for devices. More...

#include "xrt/xrt_device.h"
Include dependency graph for xrt_prober.h:

Go to the source code of this file.

Data Structures

struct  xrt_prober_device
 A probed device, may or may not be opened. More...
 
struct  xrt_prober
 The main prober that probes and manages found but not opened HMD devices that are connected to the system. More...
 
struct  xrt_builder_estimate
 A estimate from a setter upper about how many devices they can open. More...
 
struct  xrt_builder
 Sets up a collection of devices and builds a system, a setter upper. More...
 
struct  xrt_prober_entry
 Entry for a single device. More...
 
interface  xrt_auto_prober
 An interface to be exposed by a device driver that should probe for the existence of its own device on the system, rather than using shared probers with vendor/product IDs, etc. More...
 
struct  xrt_prober_entry_lists
 Main root of all of the probing device. More...
 

Macros

#define XRT_MAX_DEVICES_PER_PROBE   16
 The maximum number of devices that a single xrt_prober_entry::found or xrt_auto_prober::lelo_dallas_autoprobe function called by the prober can create per-call. More...
 
#define XRT_MAX_AUTO_PROBERS   16
 The maximum number of xrt_auto_prober instances that can be handled. More...
 

Typedefs

typedef struct cJSON cJSON
 
typedef void(* xrt_prober_list_video_func_t) (struct xrt_prober *xp, struct xrt_prober_device *pdev, const char *product, const char *manufacturer, const char *serial, void *ptr)
 Callback for listing video devices. More...
 
typedef struct xrt_builder *(* xrt_builder_create_func_t) (void)
 Function pointer type for creating a xrt_builder. More...
 
typedef int(* xrt_prober_found_func_t) (struct xrt_prober *xp, struct xrt_prober_device **devices, size_t num_devices, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs)
 Function pointer type for a handler that gets called when a device matching vendor and product ID is detected. More...
 
typedef struct xrt_auto_prober *(* xrt_auto_prober_create_func_t) (void)
 Function pointer type for creating a auto prober. More...
 

Enumerations

enum  xrt_bus_type { XRT_BUS_TYPE_UNKNOWN , XRT_BUS_TYPE_USB , XRT_BUS_TYPE_BLUETOOTH }
 Bus type of a device. More...
 
enum  xrt_prober_string { XRT_PROBER_STRING_MANUFACTURER , XRT_PROBER_STRING_PRODUCT , XRT_PROBER_STRING_SERIAL_NUMBER }
 String descriptor types. More...
 

Detailed Description

Common interface to probe for devices.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Typedef Documentation

◆ xrt_prober_found_func_t

typedef int(* xrt_prober_found_func_t) (struct xrt_prober *xp, struct xrt_prober_device **devices, size_t num_devices, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs)

Function pointer type for a handler that gets called when a device matching vendor and product ID is detected.

Parameters
xpProber
devicesThe array of prober devices found by the prober.
num_devicesThe number of elements in devices
indexWhich element in the prober device array matches your query?
attached_data
out_xdevsAn empty array of size XRT_MAX_DEVICES_PER_PROBE you may populate with xrt_device instances.
Returns
the number of elements of out_xdevs populated by this call.

Enumeration Type Documentation

◆ xrt_bus_type

Bus type of a device.

◆ xrt_prober_string

String descriptor types.