27typedef struct cJSON cJSON;
51#define XRT_MAX_DEVICES_PER_PROBE 16
58#define XRT_MAX_AUTO_PROBERS 16
67 XRT_BUS_TYPE_BLUETOOTH,
75 XRT_PROBER_STRING_MANUFACTURER,
76 XRT_PROBER_STRING_PRODUCT,
77 XRT_PROBER_STRING_SERIAL_NUMBER,
122 const char *manufacturer,
163 size_t *out_device_count);
277 size_t *out_builder_count,
279 size_t *out_entry_count,
299 unsigned char *out_buffer,
332 return xp->
probe(xp);
345 return xp->
lock_list(xp, out_devices, out_device_count);
368XRT_NONNULL_ALL
static inline int
371 return xp->
dump(xp, use_stdout);
397XRT_NONNULL_ALL
static inline int
400 return xp->
select(xp, xdevs, xdev_capacity);
410XRT_NONNULL_ALL
static inline int
426XRT_NONNULL_ALL
static inline int
430 unsigned char *out_buffer,
443XRT_NONNULL_ALL
static inline bool
457XRT_NONNULL_FIRST
static inline int
486XRT_NONNULL_ALL
static inline int
488 size_t *out_builder_count,
490 size_t *out_entry_count,
494 return xp->
get_builders(xp, out_builder_count, out_builders, out_entry_count, out_entries, out_auto_probers);
505XRT_NONNULL_ALL
static inline void
537 uint32_t extra_device_count;
553typedef struct xrt_builder *(*xrt_builder_create_func_t)(void);
651 return xb->
open_system(xb, config, xp, broadcast, out_xsysd, out_xso);
662XRT_NONNULL_ALL
static inline void
698 cJSON *attached_data,
785 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:119
struct xrt_auto_prober *(* xrt_auto_prober_create_func_t)(void)
Function pointer type for creating a auto prober.
Definition: xrt_prober.h:750
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:553
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:762
void(* destroy)(struct xrt_auto_prober *xap)
Destroy this auto-prober.
Definition: xrt_prober.h:794
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:784
A estimate from a setter upper about how many devices they can open.
Definition: xrt_prober.h:530
int32_t priority
A setter upper defined priority, mostly for vive vs survive.
Definition: xrt_prober.h:545
Sets up a collection of devices and builds a system, a setter upper.
Definition: xrt_prober.h:561
static XRT_NONNULL_ALL 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:628
const char ** driver_identifiers
List of identifiers for drivers this setter-upper uses/supports.
Definition: xrt_prober.h:569
static XRT_NONNULL_ALL 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:644
static XRT_NONNULL_ALL void xrt_builder_destroy(struct xrt_builder **xb_ptr)
Destroy this setter upper.
Definition: xrt_prober.h:663
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:588
void(* destroy)(struct xrt_builder *xb)
Destroy this setter upper.
Definition: xrt_prober.h:617
bool exclude_from_automatic_discovery
Should this builder be excluded from automatic discovery.
Definition: xrt_prober.h:575
const char * name
"Localized" pretty name.
Definition: xrt_prober.h:566
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:605
size_t driver_identifier_count
Number of driver identifiers.
Definition: xrt_prober.h:572
const char * identifier
Short identifier, like "vive", "north_star", "rgb_tracking".
Definition: xrt_prober.h:563
A single HMD or input device.
Definition: xrt_device.h:310
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:86
uint16_t product_id
USB/Bluetooth product ID (PID)
Definition: xrt_prober.h:95
uint8_t usb_dev_class
USB device class.
Definition: xrt_prober.h:105
uint16_t vendor_id
USB/Bluetooth vendor ID (VID)
Definition: xrt_prober.h:90
enum xrt_bus_type bus
Device bus type.
Definition: xrt_prober.h:100
Main root of all of the probing device.
Definition: xrt_prober.h:810
struct xrt_prober_entry ** entries
A null terminated list of null terminated lists of xrt_prober_entry.
Definition: xrt_prober.h:820
xrt_builder_create_func_t * builders
A null terminated list of xrt_builder creation functions.
Definition: xrt_prober.h:814
struct xrt_prober_entry_lists * next
Lets you chain multiple prober entry lists.
Definition: xrt_prober.h:830
xrt_auto_prober_create_func_t * auto_probers
A null terminated list of xrt_auto_prober creation functions.
Definition: xrt_prober.h:825
Entry for a single device.
Definition: xrt_prober.h:707
uint16_t product_id
USB/Bluetooth product ID (PID) to filter on.
Definition: xrt_prober.h:716
xrt_prober_found_func_t found
Handler that gets called when a device matching vendor and product ID is detected.
Definition: xrt_prober.h:723
uint16_t vendor_id
USB/Bluetooth vendor ID (VID) to filter on.
Definition: xrt_prober.h:711
const char * driver_name
A human-readable name for the driver associated with this VID/PID.
Definition: xrt_prober.h:735
const char * name
A human-readable name for the device associated with this VID/PID.
Definition: xrt_prober.h:728
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition: xrt_prober.h:133
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:161
struct xrt_tracking_factory * tracking
Factory for producing tracked objects.
Definition: xrt_prober.h:135
static XRT_NONNULL_ALL void xrt_prober_destroy(struct xrt_prober **xp_ptr)
Destroy the prober and set the pointer to null.
Definition: xrt_prober.h:506
static XRT_NONNULL_ALL 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:330
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:226
static XRT_NONNULL_ALL 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:398
static XRT_NONNULL_ALL 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:444
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:172
XRT_NONNULL_ALL 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:146
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:247
static XRT_NONNULL_FIRST 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:458
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:238
bool(* can_open)(struct xrt_prober *xp, struct xrt_prober_device *xpdev)
Determine whether a prober device can be opened.
Definition: xrt_prober.h:310
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:183
static XRT_NONNULL_ALL 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:427
static XRT_NONNULL_ALL 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:343
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:296
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:276
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:262
static XRT_NONNULL_ALL 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:369
static XRT_NONNULL_ALL 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:356
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:195
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:474
xrt_result_t(* probe)(struct xrt_prober *xp)
Enumerate all connected devices, whether or not we have an associated driver.
Definition: xrt_prober.h:151
static XRT_NONNULL_ALL 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:411
static XRT_NONNULL_ALL 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:487
static XRT_NONNULL_ALL 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:382
void(* destroy)(struct xrt_prober **xp_ptr)
Destroy the prober and set the pointer to null.
Definition: xrt_prober.h:319
Used internally from producers of events to push events into session, some sinks might multiplex even...
Definition: xrt_session.h:237
Object that oversees and manages spaces, one created for each XR system.
Definition: xrt_space.h:97
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition: xrt_system.h:221
Tracking factory.
Definition: xrt_tracking.h:94
Header defining an xrt display or controller device.
xrt_prober_string
String descriptor types.
Definition: xrt_prober.h:74
xrt_bus_type
Bus type of a device.
Definition: xrt_prober.h:64
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:694