]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change hole fill position
authorBastian Dehn <hhaalo@arcor.de>
Tue, 18 Feb 2025 16:30:50 +0000 (17:30 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 18 Feb 2025 16:30:50 +0000 (17:30 +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 96caaee4bb8e7b5e1060f6e661ad459e85ac62be..2e490557ee10ee7a260c9f87843f77e7ea3694eb 100644 (file)
@@ -255,7 +255,7 @@ void kds_s2000w_handler_opts_get_option(handler* h, uint32_t option, void* value
                        _kds_s2000w_handler_opts_write_int_value(value_object, value);
                        break;
                case 35:
-                       value_object = json_object_object_get(config, "MaxDocumentLength");
+                       value_object = json_object_object_get(config, "HoleFill");
                        _kds_s2000w_handler_opts_write_int_value(value_object, value);
                        break;
                case 36:
@@ -271,7 +271,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 39:
-                       value_object = json_object_object_get(config, "HoleFill");
+                       value_object = json_object_object_get(config, "MaxDocumentLength");
                        _kds_s2000w_handler_opts_write_int_value(value_object, value);
                        break;
                case 40:
@@ -460,7 +460,7 @@ void kds_s2000w_handler_opts_set_option(handler* h, uint32_t option, void* value
                        _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
                        break;
                case 35:
-                       value_object = json_object_object_get(config, "MaxDocumentLength");
+                       value_object = json_object_object_get(config, "HoleFill");
                        _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
                        break;
                case 36:
@@ -476,7 +476,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 39:
-                       value_object = json_object_object_get(config, "HoleFill");
+                       value_object = json_object_object_get(config, "MaxDocumentLength");
                        _kds_s2000w_handler_opts_write_int_value_to_json(value_object, value);
                        break;
                case 40:
index c7a503c236e318ad732df1c38218093c5f532686..9c373eb540fb4c53b39460000e237839c3de45fa 100644 (file)
@@ -1131,11 +1131,11 @@ void kds_s2000w_option_descriptors_init()
        descriptor_array[32] = _kds_s2000w_option_descriptor_image_processing_group();
        descriptor_array[33] = _kds_s2000w_option_descriptor_skip_blank_pages();
        descriptor_array[34] = _kds_s2000w_option_descriptor_skip_blank_page_content();
-       descriptor_array[35] = _kds_s2000w_option_descriptor_max_document_length();
+       descriptor_array[35] = _kds_s2000w_option_descriptor_hole_fill();
        descriptor_array[36] = _kds_s2000w_option_descriptor_document_feeder_timeout();
        descriptor_array[37] = _kds_s2000w_option_descriptor_multifeed_response();
        descriptor_array[38] = _kds_s2000w_option_descriptor_image_border();
-       descriptor_array[39] = _kds_s2000w_option_descriptor_hole_fill();
+       descriptor_array[39] = _kds_s2000w_option_descriptor_max_document_length();
        descriptor_array[40] = _kds_s2000w_option_descriptor_document_feeder_timeout_response();
        descriptor_array[41] = _kds_s2000w_option_descriptor_post_scan_rotation();
        descriptor_array[42] = _kds_s2000w_option_descriptor_edge_fill();
index f6c1038087b6249c4b08933747bc2e141c25bddf..17f90548be0768be240e5d5e41af2d7f0ab52e59 100644 (file)
@@ -459,7 +459,7 @@ void sane_kds_s2000w_net_control_get_option_thirdyfive_test(void** state)
 
        sane_kds_s2000w_net_control_option(h, 35, SANE_ACTION_GET_VALUE, &value, NULL);
 
-       assert_int_equal(value, 140);
+       assert_int_equal(value, 0);
 
        kds_s2000w_handler_free(h);
        h = NULL;
@@ -519,7 +519,7 @@ void sane_kds_s2000w_net_control_get_option_thirdynine_test(void** state)
 
        sane_kds_s2000w_net_control_option(h, 39, SANE_ACTION_GET_VALUE, &value, NULL);
 
-       assert_int_equal(value, 0);
+       assert_int_equal(value, 140);
 
        kds_s2000w_handler_free(h);
        h = NULL;
index 702bdb684acefbbdf394a68c1c4bce0156942deb..a73850dd7b569b47cf8e0ec89cb7ac61ea4085f7 100644 (file)
@@ -614,17 +614,14 @@ void kds_s2000w_option_get_descriptor_thirdyfive_test()
 {
        SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(35);
 
-       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_string_equal("hole-fill", option->name);
+       assert_string_equal("Hole Fill", option->title);
+       assert_string_equal("Hole Fill", option->desc);
+       assert_int_equal(SANE_TYPE_BOOL, option->type);
        assert_int_equal(SANE_UNIT_NONE, option->unit);
-       assert_int_equal(sizeof(SANE_Int), option->size);
+       assert_int_equal(sizeof(SANE_Bool), 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->quant, 1);
+       assert_int_equal(SANE_CONSTRAINT_NONE, option->constraint_type);
 }
 
 void kds_s2000w_option_get_descriptor_thirdysix_test()
@@ -683,14 +680,17 @@ void kds_s2000w_option_get_descriptor_thirdynine_test()
 {
        SANE_Option_Descriptor* option = kds_s2000w_option_descriptors_get(39);
 
-       assert_string_equal("hole-fill", option->name);
-       assert_string_equal("Hole Fill", option->title);
-       assert_string_equal("Hole Fill", option->desc);
-       assert_int_equal(SANE_TYPE_BOOL, option->type);
+       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_Bool), option->size);
+       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_NONE, option->constraint_type);
+       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->quant, 1);
 }
 
 void kds_s2000w_option_get_descriptor_fourty_test()