]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add read option seven
authorBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jan 2024 10:34:34 +0000 (11:34 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jan 2024 10:34:34 +0000 (11:34 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_net.c

index e72c9e29c49c768abdc9501f12c9d6df3bbaf6af..548eb85407f33d7cf7d744b28927da5151e84eac 100644 (file)
@@ -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;
index a089bf3309739fd2f1128e97a47f6b3ba79803b3..bddf89b5bd064cccd51ce054a8aac1b4f16e070c 100644 (file)
@@ -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;