Monado OpenXR Runtime
Data Structures | Macros | Functions

Main prober code. More...

#include "xrt/xrt_config_have.h"
#include "xrt/xrt_config_os.h"
#include "xrt/xrt_compiler.h"
#include "xrt/xrt_prober.h"
#include "xrt/xrt_settings.h"
Include dependency graph for p_prober.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  prober_device
 A prober device. More...
 
struct  prober
 

Macros

#define P_SPEW(p, ...)
 
#define P_DEBUG(p, ...)
 
#define P_ERROR(p, ...)
 
#define MAX_AUTO_PROBERS   8
 

Functions

cJSONp_json_open_or_create_main_file (void)
 Load the JSON config file. More...
 
bool p_json_get_tracking_settings (cJSON *root, struct xrt_settings_tracking *s)
 Extract tracking settings from the JSON. More...
 
void p_dump_device (struct prober *p, struct prober_device *pdev, int id)
 Dump the given device to stdout. More...
 
int p_dev_get_usb_dev (struct prober *p, uint16_t bus, uint16_t addr, uint16_t vendor_id, uint16_t product_id, struct prober_device **out_pdev)
 Get or create a prober_device from the device. More...
 
int p_dev_get_bluetooth_dev (struct prober *p, uint64_t id, uint16_t vendor_id, uint16_t product_id, struct prober_device **out_pdev)
 Get or create a prober_device from the device. More...
 
int p_tracking_init (struct prober *p)
 Init the tracking factory. More...
 
void p_tracking_teardown (struct prober *p)
 Teardown the tracking factory. More...
 

Detailed Description

Main prober code.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ MAX_AUTO_PROBERS

#define MAX_AUTO_PROBERS   8

◆ P_DEBUG

#define P_DEBUG (   p,
  ... 
)
Value:
do { \
if (p->print_debug) { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} \
} while (false)

◆ P_ERROR

#define P_ERROR (   p,
  ... 
)
Value:
do { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} while (false)

Referenced by p_dev_get_bluetooth_dev(), p_dev_get_usb_dev(), p_libusb_can_open(), p_libusb_get_string_descriptor(), p_libusb_probe(), p_libuvc_probe(), and p_udev_probe().

◆ P_SPEW

#define P_SPEW (   p,
  ... 
)
Value:
do { \
if (p->print_spew) { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} \
} while (false)

Referenced by p_libusb_probe(), and p_libuvc_probe().

Function Documentation

◆ p_dev_get_bluetooth_dev()

int p_dev_get_bluetooth_dev ( struct prober p,
uint64_t  id,
uint16_t  vendor_id,
uint16_t  product_id,
struct prober_device **  out_pdev 
)

◆ p_dev_get_usb_dev()

int p_dev_get_usb_dev ( struct prober p,
uint16_t  bus,
uint16_t  addr,
uint16_t  vendor_id,
uint16_t  product_id,
struct prober_device **  out_pdev 
)

◆ p_dump_device()

void p_dump_device ( struct prober p,
struct prober_device pdev,
int  id 
)

◆ p_json_get_tracking_settings()

bool p_json_get_tracking_settings ( cJSON root,
struct xrt_settings_tracking s 
)

Extract tracking settings from the JSON.

◆ p_json_open_or_create_main_file()

cJSON* p_json_open_or_create_main_file ( void  )

Load the JSON config file.

References read_content(), and u_file_open_file_in_config_dir().

◆ p_tracking_init()

int p_tracking_init ( struct prober p)

◆ p_tracking_teardown()

void p_tracking_teardown ( struct prober p)

Teardown the tracking factory.

References prober::base, and xrt_prober::tracking.