From 2aed9f5b51760c61876854b5dc2d60b2aedb81c8 Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Wed, 26 Mar 2025 16:41:18 -0400 Subject: [PATCH] Improve logging over device specific configs --- src/monocoque/helper/confighelper.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/monocoque/helper/confighelper.c b/src/monocoque/helper/confighelper.c index 1aef3d9..f0004aa 100644 --- a/src/monocoque/helper/confighelper.c +++ b/src/monocoque/helper/confighelper.c @@ -870,16 +870,24 @@ int uiloadconfig(const char* config_file_str, int confignum, int configureddevic DeviceSettings settings; config_setting_t* config_device = config_setting_get_elem(config_devices, i); - const char* device_type; - const char* device_subtype; - const char* device_config_file; + const char* device_type = NULL; + const char* device_subtype = NULL; + const char* device_config_file = NULL; + int found = 0; config_setting_lookup_string(config_device, "device", &device_type); config_setting_lookup_string(config_device, "type", &device_subtype); - config_setting_lookup_string(config_device, "config", &device_config_file); + found = config_setting_lookup_string(config_device, "config", &device_config_file); slogt("device type: %s", device_type); slogt("device sub type: %s", device_subtype); - slogt("device config file: %s", device_config_file); + if(found == CONFIG_FALSE) + { + device_config_file = NULL; + } + else + { + slogt("device config file: %s", device_config_file); + } if (error == MONOCOQUE_ERROR_NONE) { error = devsetup(device_type, device_subtype, device_config_file, ms, &settings, config_device);