The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xrt: Re-order things in xrt_prober

authored by

Jakob Bornecrantz and committed by
Jakob Bornecrantz
aeb11566 3a9ac6aa

+74 -64
+74 -64
src/xrt/include/xrt/xrt_prober.h
··· 28 28 struct xrt_fs; 29 29 struct xrt_frame_context; 30 30 struct xrt_prober; 31 + struct xrt_prober_entry; 31 32 struct xrt_prober_device; 33 + struct xrt_prober_entry_lists; 34 + struct xrt_auto_prober; 32 35 struct xrt_tracking_factory; 33 36 struct os_hid_device; 34 37 ··· 43 46 #define XRT_MAX_DEVICES_PER_PROBE 16 44 47 45 48 #define XRT_MAX_AUTO_PROBERS 16 46 - 47 - /*! 48 - * Function pointer type for a handler that gets called when a device matching vendor and product ID is detected. 49 - * 50 - * @param xp Prober 51 - * @param devices The array of prober devices found by the prober. 52 - * @param num_devices The number of elements in @p devices 53 - * @param index Which element in the prober device array matches your query? 54 - * @param attached_data 55 - * @param out_xdevs An empty array of size @p XRT_MAX_DEVICES_PER_PROBE you may populate with @ref xrt_device 56 - * instances. 57 - * 58 - * @return the number of elements of @p out_xdevs populated by this call. 59 - */ 60 - typedef int (*xrt_prober_found_func_t)(struct xrt_prober *xp, 61 - struct xrt_prober_device **devices, 62 - size_t num_devices, 63 - size_t index, 64 - cJSON *attached_data, 65 - struct xrt_device **out_xdevs); 66 - 67 - /*! 68 - * Entry for a single device. 69 - * 70 - * @ingroup xrt_iface 71 - */ 72 - struct xrt_prober_entry 73 - { 74 - /*! 75 - * USB/Bluetooth vendor ID (VID) to filter on. 76 - */ 77 - uint16_t vendor_id; 78 - 79 - /*! 80 - * USB/Bluetooth product ID (PID) to filter on. 81 - */ 82 - uint16_t product_id; 83 - 84 - /*! 85 - * Handler that gets called when a device matching vendor and product ID is detected. 86 - * 87 - * @see xrt_prober_found_func_t 88 - */ 89 - xrt_prober_found_func_t found; 90 - 91 - /*! 92 - * A human-readable name for the device associated with this VID/PID. 93 - */ 94 - const char *name; 95 - 96 - /*! 97 - * A human-readable name for the driver associated with this VID/PID. 98 - * 99 - * Separate because a single driver might handle multiple VID/PID entries. 100 - */ 101 - const char *driver_name; 102 - }; 103 - 104 - /*! 105 - * Function pointer type for creating a auto prober. 106 - * 107 - * @ingroup xrt_iface 108 - */ 109 - typedef struct xrt_auto_prober *(*xrt_auto_prober_create_func_t)(); 110 49 111 50 /*! 112 51 * Bus type of a device. ··· 431 370 432 371 /* 433 372 * 373 + * Found device interface. 374 + * 375 + */ 376 + 377 + /*! 378 + * Function pointer type for a handler that gets called when a device matching vendor and product ID is detected. 379 + * 380 + * @param xp Prober 381 + * @param devices The array of prober devices found by the prober. 382 + * @param num_devices The number of elements in @p devices 383 + * @param index Which element in the prober device array matches your query? 384 + * @param attached_data 385 + * @param out_xdevs An empty array of size @p XRT_MAX_DEVICES_PER_PROBE you may populate with @ref xrt_device 386 + * instances. 387 + * 388 + * @return the number of elements of @p out_xdevs populated by this call. 389 + */ 390 + typedef int (*xrt_prober_found_func_t)(struct xrt_prober *xp, 391 + struct xrt_prober_device **devices, 392 + size_t num_devices, 393 + size_t index, 394 + cJSON *attached_data, 395 + struct xrt_device **out_xdevs); 396 + 397 + /*! 398 + * Entry for a single device. 399 + * 400 + * @ingroup xrt_iface 401 + */ 402 + struct xrt_prober_entry 403 + { 404 + /*! 405 + * USB/Bluetooth vendor ID (VID) to filter on. 406 + */ 407 + uint16_t vendor_id; 408 + 409 + /*! 410 + * USB/Bluetooth product ID (PID) to filter on. 411 + */ 412 + uint16_t product_id; 413 + 414 + /*! 415 + * Handler that gets called when a device matching vendor and product ID is detected. 416 + * 417 + * @see xrt_prober_found_func_t 418 + */ 419 + xrt_prober_found_func_t found; 420 + 421 + /*! 422 + * A human-readable name for the device associated with this VID/PID. 423 + */ 424 + const char *name; 425 + 426 + /*! 427 + * A human-readable name for the driver associated with this VID/PID. 428 + * 429 + * Separate because a single driver might handle multiple VID/PID entries. 430 + */ 431 + const char *driver_name; 432 + }; 433 + 434 + 435 + /* 436 + * 434 437 * Auto prober. 435 438 * 436 439 */ 440 + 441 + /*! 442 + * Function pointer type for creating a auto prober. 443 + * 444 + * @ingroup xrt_iface 445 + */ 446 + typedef struct xrt_auto_prober *(*xrt_auto_prober_create_func_t)(); 437 447 438 448 /*! 439 449 * @interface xrt_auto_prober