From: Bastian Dehn Date: Wed, 24 Jan 2024 20:06:35 +0000 (+0100) Subject: add type description in current_state X-Git-Tag: v1.0.0^2~466 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=a0fdf32bb213e687e4011aefe4a6721fc56cad25;p=sane-kds-s2000w-net.git add type description in current_state --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index c963630..47a39ff 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -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; } } diff --git a/src/kds_s2000w_handler.h b/src/kds_s2000w_handler.h index 292f49d..a215492 100644 --- a/src/kds_s2000w_handler.h +++ b/src/kds_s2000w_handler.h @@ -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();