From: Bastian Dehn Date: Sat, 27 Jan 2024 10:27:12 +0000 (+0100) Subject: add read option five X-Git-Tag: v1.0.0^2~447 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=38307ea4227b3249b95853917830dae80a056f52;p=sane-kds-s2000w-net.git add read option five --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 76a2150..b276454 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 = 5; + *int_value_ptr = 6; break; case 1: value_object = json_object_object_get(config, "DPI"); @@ -115,6 +115,12 @@ void kds_s2000w_handler_get_option(int option, void* value) int_value_ptr = (int*) value; *int_value_ptr = int_value; break; + case 5: + value_object = json_object_object_get(config, "AutoStart"); + 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 d9edacb..cd53e14 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -156,6 +156,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 5: + 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 = "autostart"; + option_descriptor_array.option_descriptors[option]->title = "autostart"; + option_descriptor_array.option_descriptors[option]->desc = "autostart"; + 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; @@ -166,6 +177,7 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor( case 0: case 1: case 4: + case 5: option_descriptor_array.option_descriptors[option]->type = SANE_TYPE_INT; option_descriptor_array.option_descriptors[option]->size = sizeof(SANE_Int); break;