From 43dcdd7bd869d6f0853cb4908fc04618f85fe75e Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 29 Jan 2024 16:02:35 +0100 Subject: [PATCH] add reset config button --- src/kds_s2000w_handler.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index c59962b..a3e0bab 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -315,19 +315,16 @@ void kds_s2000w_handler_set_option(int option, void* value, int* info) _write_string_value_to_json(value_object, value); break; case 24: - printf("Konfiguration reset\n"); resp = kds_s2000w_client_response_init(); kds_s2000w_client_get_capabilities(resp); - printf("response data: %s\n", resp->data); - json_object* capabilities = json_tokener_parse(resp->data); json_object* default_values = json_object_object_get(capabilities, "Defaults"); - const char* json_string = json_object_to_json_string_ext(default_values, JSON_C_TO_STRING_PLAIN); - printf("default_values: %s\n", json_string); + json_object* default_config = json_object_new_object(); + json_object_object_add(default_config, "Configuration", default_values); + const char* json_string = json_object_to_json_string_ext(default_config, JSON_C_TO_STRING_PLAIN); kds_s2000w_client_response_free(resp); - resp = kds_s2000w_client_response_init(); resp->size = sizeof(char) * strlen(json_string); resp->code = 0; -- 2.39.5