From 9ee5f24f9f85e10664cf2e33c9b7f4fa0c1e1475 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 18 Feb 2025 18:01:16 +0100 Subject: [PATCH] change max document length position --- src/kds_s2000w_handler_opts.c | 8 ++++---- src/kds_s2000w_option_descriptors.c | 8 ++++---- tests/kds_s2000w_net_get_opt_tests.c | 4 ++-- tests/kds_s2000w_option_descriptor_tests.c | 21 +++++++++++---------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index ec0cfc3..d27d687 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -275,7 +275,7 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value _kds_s2000w_handler_opts_write_string_value(value_object, value); break; case 41: - value_object = json_object_object_get(config, "DocumentFeederTimeout"); + value_object = json_object_object_get(config, "MaxDocumentLength"); _kds_s2000w_handler_opts_write_int_value(value_object, value); break; case 42: @@ -291,7 +291,7 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value _kds_s2000w_handler_opts_write_string_value(value_object, value); break; case 45: - value_object = json_object_object_get(config, "MaxDocumentLength"); + value_object = json_object_object_get(config, "DocumentFeederTimeout"); _kds_s2000w_handler_opts_write_int_value(value_object, value); break; case 46: @@ -480,7 +480,7 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value _kds_s2000w_handler_opts_write_string_value_to_json(value_object, value); break; case 41: - value_object = json_object_object_get(config, "DocumentFeederTimeout"); + value_object = json_object_object_get(config, "MaxDocumentLength"); _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value); break; case 42: @@ -496,7 +496,7 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value _kds_s2000w_handler_opts_write_string_value_to_json(value_object, value); break; case 45: - value_object = json_object_object_get(config, "MaxDocumentLength"); + value_object = json_object_object_get(config, "DocumentFeederTimeout"); _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value); break; case 46: diff --git a/src/kds_s2000w_option_descriptors.c b/src/kds_s2000w_option_descriptors.c index 71438d9..bd855ef 100644 --- a/src/kds_s2000w_option_descriptors.c +++ b/src/kds_s2000w_option_descriptors.c @@ -880,8 +880,8 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_max_document_length() SANE_Option_Descriptor descriptor = { "max-document-length", - "Max document length", - "Max document length", + "Max Document Length", + "Max Document Length", SANE_TYPE_INT, SANE_UNIT_NONE, sizeof(SANE_Int), @@ -1155,11 +1155,11 @@ void kds_s2000w_option_descriptors_init() descriptor_array[38] = _kds_s2000w_option_descriptor_image_border(); descriptor_array[39] = _kds_s2000w_option_descriptor_jpeg_quality(); descriptor_array[40] = _kds_s2000w_option_descriptor_feeder_group(); - descriptor_array[41] = _kds_s2000w_option_descriptor_document_feeder_timeout(); + descriptor_array[41] = _kds_s2000w_option_descriptor_max_document_length(); descriptor_array[42] = _kds_s2000w_option_descriptor_multifeed_response(); descriptor_array[43] = _kds_s2000w_option_descriptor_transport_handling(); descriptor_array[44] = _kds_s2000w_option_descriptor_multifeed_sensitivity(); - descriptor_array[45] = _kds_s2000w_option_descriptor_max_document_length(); + descriptor_array[45] = _kds_s2000w_option_descriptor_document_feeder_timeout(); descriptor_array[46] = _kds_s2000w_option_descriptor_document_feeder_timeout_response(); } diff --git a/tests/kds_s2000w_net_get_opt_tests.c b/tests/kds_s2000w_net_get_opt_tests.c index 6add228..7670e27 100644 --- a/tests/kds_s2000w_net_get_opt_tests.c +++ b/tests/kds_s2000w_net_get_opt_tests.c @@ -534,7 +534,7 @@ void sane_kds_s2000w_net_control_get_option_fourtyone_test(void** state) sane_kds_s2000w_net_control_option(h, 41, SANE_ACTION_GET_VALUE, &value, NULL); - assert_int_equal(value, 2); + assert_int_equal(value, 140); kds_s2000w_handler_free(h); h = NULL; @@ -594,7 +594,7 @@ void sane_kds_s2000w_net_control_get_option_fourtyfive_test(void** state) sane_kds_s2000w_net_control_option(h, 45, SANE_ACTION_GET_VALUE, &value, NULL); - assert_int_equal(value, 140); + assert_int_equal(value, 2); kds_s2000w_handler_free(h); h = NULL; diff --git a/tests/kds_s2000w_option_descriptor_tests.c b/tests/kds_s2000w_option_descriptor_tests.c index 5aa9c0e..4fe2a59 100644 --- a/tests/kds_s2000w_option_descriptor_tests.c +++ b/tests/kds_s2000w_option_descriptor_tests.c @@ -718,16 +718,17 @@ void kds_s2000w_option_get_descriptor_fourtyone_test() { SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(41); - assert_string_equal("document-feeder-timeout", option->name); - assert_string_equal("Document feeder timeout", option->title); - assert_string_equal("Document feeder timeout", option->desc); + + assert_string_equal("max-document-length", option->name); + assert_string_equal("Max Document Length", option->title); + assert_string_equal("Max Document Length", option->desc); assert_int_equal(SANE_TYPE_INT, option->type); assert_int_equal(SANE_UNIT_NONE, option->unit); assert_int_equal(sizeof(SANE_Int), option->size); assert_int_equal(SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED, option->cap); assert_int_equal(SANE_CONSTRAINT_RANGE, option->constraint_type); - assert_int_equal(option->constraint.range->min, 0); - assert_int_equal(option->constraint.range->max, 120); + assert_int_equal(option->constraint.range->min, 25); + assert_int_equal(option->constraint.range->max, 400); assert_int_equal(option->constraint.range->quant, 1); } @@ -790,16 +791,16 @@ void kds_s2000w_option_get_descriptor_fourtyfive_test() { SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(45); - assert_string_equal("max-document-length", option->name); - assert_string_equal("Max document length", option->title); - assert_string_equal("Max document length", option->desc); + assert_string_equal("document-feeder-timeout", option->name); + assert_string_equal("Document feeder timeout", option->title); + assert_string_equal("Document feeder timeout", option->desc); assert_int_equal(SANE_TYPE_INT, option->type); assert_int_equal(SANE_UNIT_NONE, option->unit); assert_int_equal(sizeof(SANE_Int), option->size); assert_int_equal(SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED, option->cap); assert_int_equal(SANE_CONSTRAINT_RANGE, option->constraint_type); - assert_int_equal(option->constraint.range->min, 25); - assert_int_equal(option->constraint.range->max, 400); + assert_int_equal(option->constraint.range->min, 0); + assert_int_equal(option->constraint.range->max, 120); assert_int_equal(option->constraint.range->quant, 1); } -- 2.39.5