]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add get dpi option
authorBastian Dehn <hhaalo@arcor.de>
Tue, 23 Jan 2024 19:13:41 +0000 (20:13 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 23 Jan 2024 19:20:19 +0000 (20:20 +0100)
src/kds_s2000w_handler.c

index 0be3ea69a8bba22dafa87aa23ce31d263a3da5c4..bd69b8ed43cc219fd0805a9863f78988f0542788 100644 (file)
@@ -82,9 +82,17 @@ void kds_s2000w_handler_get_option(int option, void* value)
        if (_all_options == NULL)
                return;
 
+       json_object* config = NULL;
        switch(option) {
+               case 1:
+                       config = json_object_object_get(_all_options, "Configuration");
+                       json_object* dpi = json_object_object_get(config, "DPI");
+                       array_list* dpi_list = json_object_get_array(dpi);
+                       int** value_list = (int**) value;
+                       memcpy(value_list, dpi_list->array, dpi_list->size);
+                       break;
                default:
-                       json_object* config = json_object_object_get(_all_options, "Configuration");
+                       config = json_object_object_get(_all_options, "Configuration");
                        int* num_options = (int*) value;
                        *num_options = 0;
                        *num_options = json_object_object_length(config);