26typedef struct cJSON cJSON;
50#define XRT_MAX_DEVICES_PER_PROBE 16
57#define XRT_MAX_AUTO_PROBERS 16
66 XRT_BUS_TYPE_BLUETOOTH,
74 XRT_PROBER_STRING_MANUFACTURER,
75 XRT_PROBER_STRING_PRODUCT,
76 XRT_PROBER_STRING_SERIAL_NUMBER,
121 const char *manufacturer,
162 size_t *out_device_count);
276 size_t *out_builder_count,
278 size_t *out_entry_count,
298 unsigned char *out_buffer,
331 return xp->
probe(xp);
344 return xp->
lock_list(xp, out_devices, out_device_count);
370 return xp->
dump(xp, use_stdout);
399 return xp->
select(xp, xdevs, xdev_capacity);
429 unsigned char *out_buffer,
487 size_t *out_builder_count,
489 size_t *out_entry_count,
493 return xp->
get_builders(xp, out_builder_count, out_builders, out_entry_count, out_entries, out_auto_probers);
536 uint32_t extra_device_count;
552typedef struct xrt_builder *(*xrt_builder_create_func_t)(void);
650 return xb->
open_system(xb, config, xp, broadcast, out_xsysd, out_xso);
697 cJSON *attached_data,
784 cJSON *attached_data,
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.
Definition: xrt_prober.h:118
struct xrt_auto_prober *(* xrt_auto_prober_create_func_t)(void)
Function pointer type for creating a auto prober.
Definition: xrt_prober.h:749
enum xrt_result xrt_result_t
Result type used across Monado.
struct xrt_builder *(* xrt_builder_create_func_t)(void)
Function pointer type for creating a xrt_builder.
Definition: xrt_prober.h:552
Representing a single hid interface on a device.
Definition: os_hid.h:29
An interface to be exposed by a device driver that should probe for the existence of its own device o...
Definition: xrt_prober.h:761
void(* destroy)(struct xrt_auto_prober *xap)
Destroy this auto-prober.
Definition: xrt_prober.h:793
int(* lelo_dallas_autoprobe)(struct xrt_auto_prober *xap, cJSON *attached_data, bool no_hmds, struct xrt_prober *xp, struct xrt_device **out_xdevs)
Do the internal probing that the driver needs to do to find devices.
Definition: xrt_prober.h:783
A estimate from a setter upper about how many devices they can open.
Definition: xrt_prober.h:529
int32_t priority
A setter upper defined priority, mostly for vive vs survive.
Definition: xrt_prober.h:544
Sets up a collection of devices and builds a system, a setter upper.
Definition: xrt_prober.h:560
const char ** driver_identifiers
List of identifiers for drivers this setter-upper uses/supports.
Definition: xrt_prober.h:568
static xrt_result_t xrt_builder_open_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_session_event_sink *broadcast, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso)
We are now committed to opening these devices.
Definition: xrt_prober.h:643
xrt_result_t(* estimate_system)(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_builder_estimate *out_estimate)
From the devices found, estimate without opening the devices how good the system will be.
Definition: xrt_prober.h:587
void(* destroy)(struct xrt_builder *xb)
Destroy this setter upper.
Definition: xrt_prober.h:616
bool exclude_from_automatic_discovery
Should this builder be excluded from automatic discovery.
Definition: xrt_prober.h:574
const char * name
"Localized" pretty name.
Definition: xrt_prober.h:565
xrt_result_t(* open_system)(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_session_event_sink *broadcast, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso)
We are now committed to opening these devices.
Definition: xrt_prober.h:604
size_t driver_identifier_count
Number of driver identifiers.
Definition: xrt_prober.h:571
static void xrt_builder_destroy(struct xrt_builder **xb_ptr)
Destroy this setter upper.
Definition: xrt_prober.h:662
const char * identifier
Short identifier, like "vive", "north_star", "rgb_tracking".
Definition: xrt_prober.h:562
static xrt_result_t xrt_builder_estimate_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_builder_estimate *out_estimate)
From the devices found, estimate without opening the devices how good the system will be.
Definition: xrt_prober.h:627
A single HMD or input device.
Definition: xrt_device.h:241
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:108
Frameserver that generates frames.
Definition: xrt_frameserver.h:70
A probed device, may or may not be opened.
Definition: xrt_prober.h:85
uint16_t product_id
USB/Bluetooth product ID (PID)
Definition: xrt_prober.h:94
uint8_t usb_dev_class
USB device class.
Definition: xrt_prober.h:104
uint16_t vendor_id
USB/Bluetooth vendor ID (VID)
Definition: xrt_prober.h:89
enum xrt_bus_type bus
Device bus type.
Definition: xrt_prober.h:99
Main root of all of the probing device.
Definition: xrt_prober.h:809
struct xrt_prober_entry ** entries
A null terminated list of null terminated lists of xrt_prober_entry.
Definition: xrt_prober.h:819
xrt_builder_create_func_t * builders
A null terminated list of xrt_builder creation functions.
Definition: xrt_prober.h:813
struct xrt_prober_entry_lists * next
Lets you chain multiple prober entry lists.
Definition: xrt_prober.h:829
xrt_auto_prober_create_func_t * auto_probers
A null terminated list of xrt_auto_prober creation functions.
Definition: xrt_prober.h:824
Entry for a single device.
Definition: xrt_prober.h:706
uint16_t product_id
USB/Bluetooth product ID (PID) to filter on.
Definition: xrt_prober.h:715
xrt_prober_found_func_t found
Handler that gets called when a device matching vendor and product ID is detected.
Definition: xrt_prober.h:722
uint16_t vendor_id
USB/Bluetooth vendor ID (VID) to filter on.
Definition: xrt_prober.h:710
const char * driver_name
A human-readable name for the driver associated with this VID/PID.
Definition: xrt_prober.h:734
const char * name
A human-readable name for the device associated with this VID/PID.
Definition: xrt_prober.h:727
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition: xrt_prober.h:132
xrt_result_t(* lock_list)(struct xrt_prober *xp, struct xrt_prober_device ***out_devices, size_t *out_device_count)
Locks the prober list of probed devices and returns it.
Definition: xrt_prober.h:160
static int xrt_prober_open_hid_interface(struct xrt_prober *xp, struct xrt_prober_device *xpdev, int iface, struct os_hid_device **out_hid_dev)
Open a HID (Human Interface Device) interface using native HID support.
Definition: xrt_prober.h:410
struct xrt_tracking_factory * tracking
Factory for producing tracked objects.
Definition: xrt_prober.h:134
int(* select)(struct xrt_prober *xp, struct xrt_device **xdevs, size_t xdev_capacity)
Iterate through drivers (by ID and auto-probers) checking to see if they can handle any connected dev...
Definition: xrt_prober.h:225
xrt_result_t(* unlock_list)(struct xrt_prober *xp, struct xrt_prober_device ***devices)
Unlocks the list, allowing for xrt_prober::probe to be called.
Definition: xrt_prober.h:171
static xrt_result_t xrt_prober_lock_list(struct xrt_prober *xp, struct xrt_prober_device ***out_devices, size_t *out_device_count)
Locks the prober list of probed devices and returns it.
Definition: xrt_prober.h:342
int(* open_video_device)(struct xrt_prober *xp, struct xrt_prober_device *xpdev, struct xrt_frame_context *xfctx, struct xrt_fs **out_xfs)
Opens the selected video device and returns a xrt_fs, does not start it.
Definition: xrt_prober.h:246
static int xrt_prober_select(struct xrt_prober *xp, struct xrt_device **xdevs, size_t xdev_capacity)
Iterate through drivers (by ID and auto-probers) checking to see if they can handle any connected dev...
Definition: xrt_prober.h:397
int xrt_prober_create_with_lists(struct xrt_prober **out_xp, struct xrt_prober_entry_lists *list)
Create a prober with a list of known devices and autoprobers.
Definition: p_prober.c:145
int(* open_hid_interface)(struct xrt_prober *xp, struct xrt_prober_device *xpdev, int iface, struct os_hid_device **out_hid_dev)
Open a HID (Human Interface Device) interface using native HID support.
Definition: xrt_prober.h:237
static int xrt_prober_get_builders(struct xrt_prober *xp, size_t *out_builder_count, struct xrt_builder ***out_builders, size_t *out_entry_count, struct xrt_prober_entry ***out_entries, struct xrt_auto_prober ***out_auto_probers)
Retrieve the raw xrt_builder, xrt_prober_entry and xrt_auto_prober arrays.
Definition: xrt_prober.h:486
bool(* can_open)(struct xrt_prober *xp, struct xrt_prober_device *xpdev)
Determine whether a prober device can be opened.
Definition: xrt_prober.h:309
int(* dump)(struct xrt_prober *xp, bool use_stdout)
Dump a listing of all devices found on the system to logging system or platform dependent output (std...
Definition: xrt_prober.h:182
int(* get_string_descriptor)(struct xrt_prober *xp, struct xrt_prober_device *xpdev, enum xrt_prober_string which_string, unsigned char *out_buffer, size_t max_length)
Returns a string property on the device of the given type which_string in out_buffer.
Definition: xrt_prober.h:295
static int xrt_prober_open_video_device(struct xrt_prober *xp, struct xrt_prober_device *xpdev, struct xrt_frame_context *xfctx, struct xrt_fs **out_xfs)
Opens the selected video device and returns a xrt_fs, does not start it.
Definition: xrt_prober.h:457
static xrt_result_t xrt_prober_probe(struct xrt_prober *xp)
Enumerate all connected devices, whether or not we have an associated driver.
Definition: xrt_prober.h:329
int(* get_builders)(struct xrt_prober *xp, size_t *out_builder_count, struct xrt_builder ***out_builders, size_t *out_entry_count, struct xrt_prober_entry ***out_entries, struct xrt_auto_prober ***out_auto_probers)
Retrieve the raw xrt_builder, xrt_prober_entry and xrt_auto_prober arrays.
Definition: xrt_prober.h:275
int(* list_video_devices)(struct xrt_prober *xp, xrt_prober_list_video_func_t cb, void *ptr)
Iterate through available video devices, calling your callback cb with your userdata ptr.
Definition: xrt_prober.h:261
static int xrt_prober_get_string_descriptor(struct xrt_prober *xp, struct xrt_prober_device *xpdev, enum xrt_prober_string which_string, unsigned char *out_buffer, size_t max_length)
Returns a string property on the device of the given type which_string in out_buffer.
Definition: xrt_prober.h:426
static bool xrt_prober_can_open(struct xrt_prober *xp, struct xrt_prober_device *xpdev)
Determine whether a prober device can be opened.
Definition: xrt_prober.h:443
xrt_result_t(* create_system)(struct xrt_prober *xp, struct xrt_session_event_sink *broadcast, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso)
Create system devices.
Definition: xrt_prober.h:194
static void xrt_prober_destroy(struct xrt_prober **xp_ptr)
Destroy the prober and set the pointer to null.
Definition: xrt_prober.h:505
static int xrt_prober_list_video_devices(struct xrt_prober *xp, xrt_prober_list_video_func_t cb, void *ptr)
Iterate through available video devices, calling your callback cb with your userdata ptr.
Definition: xrt_prober.h:473
static xrt_result_t xrt_prober_unlock_list(struct xrt_prober *xp, struct xrt_prober_device ***devices)
Unlocks the list, allowing for xrt_prober::probe to be called.
Definition: xrt_prober.h:355
xrt_result_t(* probe)(struct xrt_prober *xp)
Enumerate all connected devices, whether or not we have an associated driver.
Definition: xrt_prober.h:150
void(* destroy)(struct xrt_prober **xp_ptr)
Destroy the prober and set the pointer to null.
Definition: xrt_prober.h:318
static int xrt_prober_dump(struct xrt_prober *xp, bool use_stdout)
Dump a listing of all devices found on the system to logging system or platform dependent output (std...
Definition: xrt_prober.h:368
static xrt_result_t xrt_prober_create_system(struct xrt_prober *xp, struct xrt_session_event_sink *broadcast, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso)
Create system devices.
Definition: xrt_prober.h:381
Used internally from producers of events to push events into session, some sinks might multiplex even...
Definition: xrt_session.h:206
Object that oversees and manages spaces, one created for each XR system.
Definition: xrt_space.h:96
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition: xrt_system.h:219
Tracking factory.
Definition: xrt_tracking.h:90
Header defining an xrt display or controller device.
xrt_prober_string
String descriptor types.
Definition: xrt_prober.h:73
xrt_bus_type
Bus type of a device.
Definition: xrt_prober.h:63
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 ...
Definition: xrt_prober.h:693