diff --git a/src/xrt/drivers/wmr/wmr_hmd.c b/src/xrt/drivers/wmr/wmr_hmd.c index e11a8c2f0..968026d8e 100644 --- a/src/xrt/drivers/wmr/wmr_hmd.c +++ b/src/xrt/drivers/wmr/wmr_hmd.c @@ -547,8 +547,13 @@ control_read_packets(struct wmr_hmd *wh) case WMR_CONTROL_MSG_DEVICE_STATUS: // WMR_DEBUG(wh, "Device status message type: %02x (size %i)", buffer[0], size); if (size != 11) { - WMR_DEBUG(wh, "---> Unexpected message size. Expected 11 bytes incl. message type."); - break; + WMR_DEBUG(wh, + "---> Unexpected message size. Expected 11 bytes incl. message type. Got %d bytes", + size); + WMR_DEBUG_HEX(wh, buffer, size); + if (size < 11) { + break; + } } // Todo: HMD state info to be decoded further. @@ -568,6 +573,7 @@ control_read_packets(struct wmr_hmd *wh) break; default: // WMR_DEBUG(wh, "Unknown message type: %02x (size %i)", buffer[0], size); + WMR_DEBUG_HEX(wh, buffer, size); break; } diff --git a/src/xrt/drivers/wmr/wmr_hmd.h b/src/xrt/drivers/wmr/wmr_hmd.h index f4a52798e..0399c8fb5 100644 --- a/src/xrt/drivers/wmr/wmr_hmd.h +++ b/src/xrt/drivers/wmr/wmr_hmd.h @@ -207,6 +207,7 @@ wmr_hmd_create(enum wmr_headset_type hmd_type, #define WMR_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) #define WMR_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) +#define WMR_DEBUG_HEX(d, data, data_size) U_LOG_XDEV_IFL_D_HEX(&d->base, d->log_level, data, data_size) #define WMR_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) #define WMR_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) #define WMR_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__)