27typedef struct cJSON cJSON;
53#define XRT_MAX_DEVICES_PER_PROBE 16
60#define XRT_MAX_AUTO_PROBERS 16
69 XRT_BUS_TYPE_BLUETOOTH,
78 XRT_PROBER_STRING_MANUFACTURER,
79 XRT_PROBER_STRING_PRODUCT,
80 XRT_PROBER_STRING_SERIAL_NUMBER,
125 const char *manufacturer,
166 size_t *out_device_count);
295 size_t *out_builder_count,
297 size_t *out_entry_count,
317 unsigned char *out_buffer,
350 return xp->
probe(xp);
363 return xp->
lock_list(xp, out_devices, out_device_count);
386XRT_NONNULL_ALL
static inline int
389 return xp->
dump(xp, use_stdout);
415XRT_NONNULL_ALL
static inline int
418 return xp->
select(xp, xdevs, xdev_capacity);
428XRT_NONNULL_ALL
static inline int
444XRT_NONNULL_ALL
static inline int
460XRT_NONNULL_ALL
static inline int
464 unsigned char *out_buffer,
477XRT_NONNULL_ALL
static inline bool
491XRT_NONNULL_FIRST
static inline int
520XRT_NONNULL_ALL
static inline int
522 size_t *out_builder_count,
524 size_t *out_entry_count,
528 return xp->
get_builders(xp, out_builder_count, out_builders, out_entry_count, out_entries, out_auto_probers);
539XRT_NONNULL_ALL
static inline void
571 uint32_t extra_device_count;
587typedef struct xrt_builder *(*xrt_builder_create_func_t)(void);
685 return xb->
open_system(xb, config, xp, broadcast, out_xsysd, out_xso);
696XRT_NONNULL_ALL
static inline void
732 cJSON *attached_data,
819 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:122
struct xrt_auto_prober *(* xrt_auto_prober_create_func_t)(void)
Function pointer type for creating a auto prober.
Definition xrt_prober.h:784
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:587
Representing a single hid interface on a device.
Definition os_hid.h:29
Representing a single serial interface on a device.
Definition os_serial.h:33
Represents the parameters for opening a serial device, such as baud rate, parity, etc.
Definition os_serial.h:54
An interface to be exposed by a device driver that should probe for the existence of its own device o...
Definition xrt_prober.h:796
void(* destroy)(struct xrt_auto_prober *xap)
Destroy this auto-prober.
Definition xrt_prober.h:828
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:818
A estimate from a setter upper about how many devices they can open.
Definition xrt_prober.h:564
int32_t priority
A setter upper defined priority, mostly for vive vs survive.
Definition xrt_prober.h:579
Sets up a collection of devices and builds a system, a setter upper.
Definition xrt_prober.h:595
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:662
const char ** driver_identifiers
List of identifiers for drivers this setter-upper uses/supports.
Definition xrt_prober.h:603
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:678
static XRT_NONNULL_ALL void xrt_builder_destroy(struct xrt_builder **xb_ptr)
Destroy this setter upper.
Definition xrt_prober.h:697
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:622
void(* destroy)(struct xrt_builder *xb)
Destroy this setter upper.
Definition xrt_prober.h:651
bool exclude_from_automatic_discovery
Should this builder be excluded from automatic discovery.
Definition xrt_prober.h:609
const char * name
"Localized" pretty name.
Definition xrt_prober.h:600
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:639
size_t driver_identifier_count
Number of driver identifiers.
Definition xrt_prober.h:606
const char * identifier
Short identifier, like "vive", "north_star", "rgb_tracking".
Definition xrt_prober.h:597
A single HMD or input device.
Definition xrt_device.h:340
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:89
uint16_t product_id
USB/Bluetooth product ID (PID)
Definition xrt_prober.h:98
uint8_t usb_dev_class
USB device class.
Definition xrt_prober.h:108
uint16_t vendor_id
USB/Bluetooth vendor ID (VID)
Definition xrt_prober.h:93
enum xrt_bus_type bus
Device bus type.
Definition xrt_prober.h:103
Main root of all of the probing device.
Definition xrt_prober.h:844
struct xrt_prober_entry ** entries
A null terminated list of null terminated lists of xrt_prober_entry.
Definition xrt_prober.h:854
xrt_builder_create_func_t * builders
A null terminated list of xrt_builder creation functions.
Definition xrt_prober.h:848
struct xrt_prober_entry_lists * next
Lets you chain multiple prober entry lists.
Definition xrt_prober.h:864
xrt_auto_prober_create_func_t * auto_probers
A null terminated list of xrt_auto_prober creation functions.
Definition xrt_prober.h:859
Entry for a single device.
Definition xrt_prober.h:741
uint16_t product_id
USB/Bluetooth product ID (PID) to filter on.
Definition xrt_prober.h:750
xrt_prober_found_func_t found
Handler that gets called when a device matching vendor and product ID is detected.
Definition xrt_prober.h:757
uint16_t vendor_id
USB/Bluetooth vendor ID (VID) to filter on.
Definition xrt_prober.h:745
const char * driver_name
A human-readable name for the driver associated with this VID/PID.
Definition xrt_prober.h:769
const char * name
A human-readable name for the device associated with this VID/PID.
Definition xrt_prober.h:762
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition xrt_prober.h:136
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:164
struct xrt_tracking_factory * tracking
Factory for producing tracked objects.
Definition xrt_prober.h:138
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:540
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:348
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:229
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:416
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:478
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:175
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:265
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:492
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:241
bool(* can_open)(struct xrt_prober *xp, struct xrt_prober_device *xpdev)
Determine whether a prober device can be opened.
Definition xrt_prober.h:328
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:186
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:461
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:361
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:314
static XRT_NONNULL_ALL int xrt_prober_open_serial_device(struct xrt_prober *xp, struct xrt_prober_device *xpdev, const struct os_serial_parameters *parameters, struct os_serial_device **out_serial_dev)
Open a serial device using native serial support.
Definition xrt_prober.h:445
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:294
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:280
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:387
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:374
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:198
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:508
xrt_result_t(* probe)(struct xrt_prober *xp)
Enumerate all connected devices, whether or not we have an associated driver.
Definition xrt_prober.h:154
int(* open_serial_device)(struct xrt_prober *xp, struct xrt_prober_device *xpdev, const struct os_serial_parameters *parameters, struct os_serial_device **out_serial_dev)
Open a serial device using native serial support.
Definition xrt_prober.h:256
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:429
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:521
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:400
void(* destroy)(struct xrt_prober **xp_ptr)
Destroy the prober and set the pointer to null.
Definition xrt_prober.h:337
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:215
Tracking factory.
Definition xrt_tracking.h:97
Header defining an xrt display or controller device.
xrt_prober_string
String descriptor types.
Definition xrt_prober.h:77
xrt_bus_type
Bus type of a device.
Definition xrt_prober.h:66
@ XRT_BUS_TYPE_ANY
Used for searching for devices of any bus type.
Definition xrt_prober.h:70
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:728