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

index 1f8d76c8b267dad4ae8c2886e75d773636714403..ac50efe5cb3ee98987fafd4f0cd679a9e18ab1db 100644 (file)
@@ -89,7 +89,7 @@ void kds_s2000w_handler_get_option(int option, void* value)
                        int_value_ptr = (int*) value;
                        int_value = json_object_object_length(config);
                        printf("option number count: %i\n", int_value);
-                       *int_value_ptr = 11;
+                       *int_value_ptr = 12;
                        break;
                case 1:
                        value_object = json_object_object_get(config, "DPI");
@@ -161,6 +161,12 @@ void kds_s2000w_handler_get_option(int option, void* value)
                        value_length = strlen(string_value) + 1;
                        memcpy(char_value, string_value, sizeof(char) * value_length);
                        break;
+               case 11:
+                       value_object = json_object_object_get(config, "ColorBalanceAggressiveness");
+                       int_value = json_object_get_int(value_object);
+                       int_value_ptr = (int*) value;
+                       *int_value_ptr = int_value;
+                       break;
                default:
                        break;
        }
index 4500cf491102355691bb90dc7b3e0111a305997b..77e197356d89d228b53d5551568de4b7920d315d 100644 (file)
@@ -222,6 +222,17 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor(
                        option_descriptor_array.option_descriptors[option]->constraint_type = SANE_CONSTRAINT_NONE;
                        option_descriptor_array.option_descriptors[option]->constraint.string_list = NULL;
                        break;
+               case 11:
+                       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 = "colorbalanceaggressiveness";
+                       option_descriptor_array.option_descriptors[option]->title = "colorbalanceaggressiveness";
+                       option_descriptor_array.option_descriptors[option]->desc = "colorbalanceaggressiveness";
+                       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;
                        break;
@@ -234,6 +245,7 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor(
                case 4:
                case 5:
                case 7:
+               case 11:
                        option_descriptor_array.option_descriptors[option]->type = SANE_TYPE_INT;
                        option_descriptor_array.option_descriptors[option]->size = sizeof(SANE_Int);
                        break;