]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add type description in current_state
authorBastian Dehn <hhaalo@arcor.de>
Wed, 24 Jan 2024 20:06:35 +0000 (21:06 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 24 Jan 2024 20:06:35 +0000 (21:06 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_handler.h

index c9636307bc6458da2df7ba9e5d2cb832a597e83b..47a39ff5f44ec1d86b37ba5a0ae600893b79da0c 100644 (file)
@@ -28,6 +28,9 @@ current_state* kds_s2000w_handler_open()
        state = malloc(sizeof(current_state));
        state->sessionid = 0;
        state->state = NOTCONNECTED;
+       state->size = 0;
+       state->length = 0;
+       state->type = INT;
 
        state->state = NOTCONNECTED;
        CURL *curl = curl_easy_init();
@@ -103,6 +106,9 @@ void kds_s2000w_handler_get_option(int option, void* value)
                        *num_options = 0;
                        *num_options = json_object_object_length(config);
                        *num_options++;
+                       state->size = sizeof(int);
+                       state->length = 1;
+                       state->type = INT;
                        break;
        }
 }
index 292f49d5a03d6f017751493e0dc928f6e8692be2..a215492cfd7d6e3498eaf6c55fd1007b7d19ae71 100644 (file)
@@ -5,9 +5,21 @@ typedef enum {
        BUSY
 } device_state;
 
+typedef enum {
+       BOOL,
+       INT,
+       FIXED,
+       STRING,
+       BUTTON,
+       GROUP
+} type;
+
 typedef struct {
        int64_t sessionid;
        device_state state;
+       size_t size;
+       size_t length;
+       type type;
 } current_state;
 
 current_state* kds_s2000w_handler_open();