From 644e4928a9b07133d764a02b7bd3ba09f9c58ef9 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 27 Jan 2024 07:08:07 +0100 Subject: [PATCH] add read option dpi --- src/kds_s2000w_handler.c | 4 +++- src/kds_s2000w_net.c | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 6aaaaf6..61a33b0 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -75,15 +75,17 @@ void kds_s2000w_handler_get_option(int option, void* value) if (result != 0 || resp->code == 404) return; + printf("DEBUG response: \n%s\n", resp->data); json_object* dpi_value_object = NULL; switch(option) { case 0: int* ignore_value = (int*) value; - *ignore_value = 0; + *ignore_value = 2; break; case 1: dpi_value_object = json_object_object_get(config, "DPI"); int dpi_value = json_object_get_int(dpi_value_object); + printf("DEBUG dpi_value: %i\n", dpi_value); int* int_value = (int*) value; *int_value = dpi_value; break; diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index 5ba9ea6..34b8bdb 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -86,7 +86,15 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor( optionDescripor->constraint.string_list = NULL; break; default: - optionDescripor = NULL; + optionDescripor->name = ""; + optionDescripor->title = "option number count"; + optionDescripor->desc = "available number of options"; + optionDescripor->type = SANE_TYPE_INT; + optionDescripor->unit = SANE_UNIT_NONE; + optionDescripor->size = sizeof(SANE_Int); + optionDescripor->cap = SANE_CAP_SOFT_SELECT; + optionDescripor->constraint_type = SANE_CONSTRAINT_NONE; + optionDescripor->constraint.string_list = NULL; break; } -- 2.39.5