]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change max document length position
authorBastian Dehn <hhaalo@arcor.de>
Tue, 18 Feb 2025 17:01:16 +0000 (18:01 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 18 Feb 2025 17:01:16 +0000 (18:01 +0100)
src/kds_s2000w_handler_opts.c
src/kds_s2000w_option_descriptors.c
tests/kds_s2000w_net_get_opt_tests.c
tests/kds_s2000w_option_descriptor_tests.c

index ec0cfc34f2011ccd3affc882ecbf3f70a509b411..d27d687b1eb1616b894d9dab6231e41706864846 100644 (file)
@@ -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:
index 71438d964121ef308354b1af9cd2cbd341786217..bd855efeeb01a866b1d9871f10050d8f46000325 100644 (file)
@@ -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();
 }
 
index 6add2286dbb2b5b07acf507e7de2a78903313fd9..7670e27ca2c66500ee3f2505926aa9b6f54156c0 100644 (file)
@@ -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;
index 5aa9c0e50c0a10b365281cdb6d46e5857f9a39e0..4fe2a59a77cc2a97615572917cd46453620c5f12 100644 (file)
@@ -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);
 }