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);