27typedef struct cJSON cJSON;
53#define XRT_MAX_DEVICES_PER_PROBE 16
60#define XRT_MAX_AUTO_PROBERS 16
69 XRT_BUS_TYPE_BLUETOOTH,
77 XRT_PROBER_STRING_MANUFACTURER,
78 XRT_PROBER_STRING_PRODUCT,
79 XRT_PROBER_STRING_SERIAL_NUMBER,
124 const char *manufacturer,
165 size_t *out_device_count);
294 size_t *out_builder_count,
296 size_t *out_entry_count,
316 unsigned char *out_buffer,
349 return xp->
probe(xp);
362 return xp->
lock_list(xp, out_devices, out_device_count);
385XRT_NONNULL_ALL
static inline int
388 return xp->
dump(xp, use_stdout);
414XRT_NONNULL_ALL
static inline int
417 return xp->
select(xp, xdevs, xdev_capacity);
427XRT_NONNULL_ALL
static inline int
443XRT_NONNULL_ALL
static inline int
459XRT_NONNULL_ALL
static inline int
463 unsigned char *out_buffer,
476XRT_NONNULL_ALL
static inline bool
490XRT_NONNULL_FIRST
static inline int
519XRT_NONNULL_ALL
static inline int
521 size_t *out_builder_count,
523 size_t *out_entry_count,
527 return xp->
get_builders(xp, out_builder_count, out_builders, out_entry_count, out_entries, out_auto_probers);
538XRT_NONNULL_ALL
static inline void
570 uint32_t extra_device_count;
586typedef struct xrt_builder *(*xrt_builder_create_func_t)(void);
684 return xb->
open_system(xb, config, xp, broadcast, out_xsysd, out_xso);
695XRT_NONNULL_ALL
static inline void
731 cJSON *attached_data,
818 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:121
struct xrt_auto_prober *(* xrt_auto_prober_create_func_t)(void)
Function pointer type for creating a auto prober.
Definition xrt_prober.h:783
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:586
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:795
void(* destroy)(struct xrt_auto_prober *xap)
Destroy this auto-prober.
Definition xrt_prober.h:827
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:817
A estimate from a setter upper about how many devices they can open.
Definition xrt_prober.h:563
int32_t priority
A setter upper defined priority, mostly for vive vs survive.
Definition xrt_prober.h:578
Sets up a collection of devices and builds a system, a setter upper.
Definition xrt_prober.h:594
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:661
const char ** driver_identifiers
List of identifiers for drivers this setter-upper uses/supports.
Definition xrt_prober.h:602
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:677
static XRT_NONNULL_ALL void xrt_builder_destroy(struct xrt_builder **xb_ptr)
Destroy this setter upper.
Definition xrt_prober.h:696
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:621
void(* destroy)(struct xrt_builder *xb)
Destroy this setter upper.
Definition xrt_prober.h:650
bool exclude_from_automatic_discovery
Should this builder be excluded from automatic discovery.
Definition xrt_prober.h:608
const char * name
"Localized" pretty name.
Definition xrt_prober.h:599
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:638
size_t driver_identifier_count
Number of driver identifiers.
Definition xrt_prober.h:605
const char * identifier
Short identifier, like "vive", "north_star", "rgb_tracking".
Definition xrt_prober.h:596
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:88
uint16_t product_id
USB/Bluetooth product ID (PID)
Definition xrt_prober.h:97
uint8_t usb_dev_class
USB device class.
Definition xrt_prober.h:107
uint16_t vendor_id
USB/Bluetooth vendor ID (VID)
Definition xrt_prober.h:92
enum xrt_bus_type bus
Device bus type.
Definition xrt_prober.h:102
Main root of all of the probing device.
Definition xrt_prober.h:843
struct xrt_prober_entry ** entries
A null terminated list of null terminated lists of xrt_prober_entry.
Definition xrt_prober.h:853
xrt_builder_create_func_t * builders
A null terminated list of xrt_builder creation functions.
Definition xrt_prober.h:847
struct xrt_prober_entry_lists * next
Lets you chain multiple prober entry lists.
Definition xrt_prober.h:863
xrt_auto_prober_create_func_t * auto_probers
A null terminated list of xrt_auto_prober creation functions.
Definition xrt_prober.h:858
Entry for a single device.
Definition xrt_prober.h:740
uint16_t product_id
USB/Bluetooth product ID (PID) to filter on.
Definition xrt_prober.h:749
xrt_prober_found_func_t found
Handler that gets called when a device matching vendor and product ID is detected.
Definition xrt_prober.h:756
uint16_t vendor_id
USB/Bluetooth vendor ID (VID) to filter on.
Definition xrt_prober.h:744
const char * driver_name
A human-readable name for the driver associated with this VID/PID.
Definition xrt_prober.h:768
const char * name
A human-readable name for the device associated with this VID/PID.
Definition xrt_prober.h:761
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition xrt_prober.h:135
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:163
struct xrt_tracking_factory * tracking
Factory for producing tracked objects.
Definition xrt_prober.h:137
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:539
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:347
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:228
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:415
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:477
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:174
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:264
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:491
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:240
bool(* can_open)(struct xrt_prober *xp, struct xrt_prober_device *xpdev)
Determine whether a prober device can be opened.
Definition xrt_prober.h:327
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:185
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:460
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:360
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:313
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:444
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:293
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:279
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:386
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:373
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:197
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:507
xrt_result_t(* probe)(struct xrt_prober *xp)
Enumerate all connected devices, whether or not we have an associated driver.
Definition xrt_prober.h:153
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:255
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:428
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:520
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:399
void(* destroy)(struct xrt_prober **xp_ptr)
Destroy the prober and set the pointer to null.
Definition xrt_prober.h:336
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:214
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:76
xrt_bus_type
Bus type of a device.
Definition xrt_prober.h:66
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:727