From e21e28c455dfe0793a2bb87abb27cadd6e865cbb Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 3 Dec 2021 20:33:55 +0000 Subject: [PATCH] u/vive: Be more verbose if we fail to parse model_[name|number] --- src/xrt/auxiliary/vive/vive_config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xrt/auxiliary/vive/vive_config.c b/src/xrt/auxiliary/vive/vive_config.c index 0f3824681..5dd0f7e3f 100644 --- a/src/xrt/auxiliary/vive/vive_config.c +++ b/src/xrt/auxiliary/vive/vive_config.c @@ -397,8 +397,10 @@ vive_config_parse(struct vive_config *d, char *json_string, enum u_logging_level if (u_json_get(json, "model_number")) { JSON_STRING(json, "model_number", d->firmware.model_number); - } else { + } else if (u_json_get(json, "model_number")) { JSON_STRING(json, "model_name", d->firmware.model_number); + } else { + VIVE_ERROR(d, "Could not find either 'model_number' or 'model_name' fields!"); } VIVE_DEBUG(d, "Parsing model number: %s", d->firmware.model_number); @@ -415,7 +417,8 @@ vive_config_parse(struct vive_config *d, char *json_string, enum u_logging_level d->variant = VIVE_VARIANT_PRO; VIVE_DEBUG(d, "Found HTC Vive Pro HMD"); } else { - VIVE_ERROR(d, "Failed to parse Vive HMD variant"); + VIVE_ERROR(d, "Failed to parse Vive HMD variant!\n\tfirmware.model_[number|name]: '%s'", + d->firmware.model_number); } switch (d->variant) {