From: Bastian Dehn Date: Sat, 27 Jan 2024 10:34:34 +0000 (+0100) Subject: add read option seven X-Git-Tag: v1.0.0^2~445 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=b8de1312d61f0f1b0a24d43cec2d3ee5308b4c7a;p=sane-kds-s2000w-net.git add read option seven --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index e72c9e2..548eb85 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -87,7 +87,7 @@ void kds_s2000w_handler_get_option(int option, void* value) switch(option) { case 0: int_value_ptr = (int*) value; - *int_value_ptr = 7; + *int_value_ptr = 8; break; case 1: value_object = json_object_object_get(config, "DPI"); @@ -127,6 +127,12 @@ void kds_s2000w_handler_get_option(int option, void* value) char_value = (char*) value; value_length = strlen(char_value); memcpy(char_value, string_value, sizeof(char) * value_length); + break; + case 7: + value_object = json_object_object_get(config, "ColorDropOutAggressiveness"); + int_value = json_object_get_int(value_object); + int_value_ptr = (int*) value; + *int_value_ptr = int_value; break; default: break; diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index a089bf3..bddf89b 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -177,6 +177,17 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor( option_descriptor_array.option_descriptors[option]->cap = SANE_CAP_SOFT_DETECT; option_descriptor_array.option_descriptors[option]->constraint_type = SANE_CONSTRAINT_NONE; option_descriptor_array.option_descriptors[option]->constraint.string_list = NULL; + break; + case 7: + free(option_descriptor_array.option_descriptors[option]); + option_descriptor_array.option_descriptors[option] = NULL; + option_descriptor_array.option_descriptors[option] = malloc(sizeof(SANE_Option_Descriptor)); + option_descriptor_array.option_descriptors[option]->name = "colordropoutaggressiveness"; + option_descriptor_array.option_descriptors[option]->title = "colordropoutaggressiveness"; + option_descriptor_array.option_descriptors[option]->desc = "colordropoutaggressiveness"; + option_descriptor_array.option_descriptors[option]->cap = SANE_CAP_SOFT_DETECT; + option_descriptor_array.option_descriptors[option]->constraint_type = SANE_CONSTRAINT_NONE; + option_descriptor_array.option_descriptors[option]->constraint.string_list = NULL; break; default: return NULL; @@ -189,6 +200,7 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor( case 1: case 4: case 5: + case 7: option_descriptor_array.option_descriptors[option]->type = SANE_TYPE_INT; option_descriptor_array.option_descriptors[option]->size = sizeof(SANE_Int); break;