st/oxr: Print out all roles

This commit is contained in:
Jakob Bornecrantz 2022-08-14 14:01:25 +01:00 committed by Jakob Bornecrantz
parent 2632c2239d
commit 4fa509034d

View file

@ -129,11 +129,21 @@ debug_print_devices(struct oxr_logger *log, struct oxr_system *sys)
struct xrt_device *h = GET_XDEV_BY_ROLE(sys, head);
struct xrt_device *l = GET_XDEV_BY_ROLE(sys, left);
struct xrt_device *r = GET_XDEV_BY_ROLE(sys, right);
struct xrt_device *hl = GET_XDEV_BY_ROLE(sys, hand_tracking.left);
struct xrt_device *hr = GET_XDEV_BY_ROLE(sys, hand_tracking.right);
oxr_log(log, "Selected devices\n\tHead: '%s' (%i)\n\tLeft: '%s' (%i)\n\tRight: '%s' (%i)", //
h ? h->str : "<none>", sys->role.head, //
l ? l->str : "<none>", sys->role.left, //
r ? r->str : "<none>", sys->role.right); //
#define P(thing) (thing != NULL ? thing->str : "<none>")
oxr_log(log,
"Selected devices"
"\n\tHead: '%s'"
"\n\tLeft: '%s'"
"\n\tRight: '%s'"
"\n\tHand-Tracking Left: '%s'"
"\n\tHand-Tracking Right: '%s'",
P(h), P(l), P(r), P(hl), P(hr));
#undef P
}
static void