From a0fdf32bb213e687e4011aefe4a6721fc56cad25 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Wed, 24 Jan 2024 21:06:35 +0100 Subject: [PATCH] add type description in current_state --- src/kds_s2000w_handler.c | 6 ++++++ src/kds_s2000w_handler.h | 12 ++++++++++++ 2 files changed, 18 insertions(+) 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(); -- 2.39.5