From: Bastian Dehn Date: Wed, 1 Oct 2025 10:30:39 +0000 (+0200) Subject: change get option per config name X-Git-Tag: v1.1.9^2~6 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=fe8615c57f692b917f494148cd8fa30e05cb20c2;p=sane-kds-s2000w-net.git change get option per config name --- diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index 8577857..4ee55a0 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -341,14 +341,14 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value option_descriptor* descriptor = kds_s2000w_option_descriptor_full_get_by_number(option); json_object* value_object = NULL; - if (option == 0) { + if (strcmp(descriptor->config_name, OPTION_COUNT) == 0) { config = json_object_object_get(h->current_scanner_config, "Configuration"); int32_t* int_value_ptr = (int32_t*) value; *int_value_ptr = kds_s2000w_option_descriptors_get_max_option_count(); return; } - if (option == 2) { + if (strcmp(descriptor->config_name, SCAN_SOURCE) == 0) { value_object = json_object_object_get(config, descriptor->config_name); _kds_s2000w_handler_opts_write_value(value_object, descriptor->descriptor->type, value);