From 8ac452a59e091bf62b9f11e68000bf4dcc35336e Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 21 Jan 2024 18:27:20 +0100 Subject: [PATCH] change descriptor for option number zero --- src/kds_s2000w_net.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index be49ccc..972b0a5 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -72,15 +72,17 @@ void _sane_kds_s2000w_net_close(SANE_Handle handle) const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor( SANE_Handle handle, SANE_Int option) { - optionDescripor->name = "test"; - optionDescripor->title = "test get option descriptor"; - optionDescripor->desc = "function get option descriptor test"; - optionDescripor->type = SANE_TYPE_BOOL; - optionDescripor->unit = SANE_UNIT_NONE; - optionDescripor->size = 0; - optionDescripor->cap = 0; - optionDescripor->constraint_type = SANE_CONSTRAINT_NONE; - optionDescripor->constraint.string_list = NULL; + if (option == 0) { + optionDescripor->name = ""; + optionDescripor->title = "count of options"; + optionDescripor->desc = "count of options"; + optionDescripor->type = SANE_TYPE_INT; + optionDescripor->unit = SANE_UNIT_NONE; + optionDescripor->size = sizeof(SANE_Int); + optionDescripor->cap = 0; + optionDescripor->constraint_type = SANE_CONSTRAINT_NONE; + optionDescripor->constraint.string_list = NULL; + } return optionDescripor; } -- 2.39.5