]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change autostart always on
authorBastian Dehn <hhaalo@arcor.de>
Mon, 4 Mar 2024 18:58:18 +0000 (19:58 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 4 Mar 2024 18:58:18 +0000 (19:58 +0100)
src/kds_s2000w_handler_opts.c

index 000f0fa15f990ff366e19343f0d428a0aa92a3ea..ec6a346437bb8c35cb84c9d5b0890c2536a8ecc4 100644 (file)
@@ -5,6 +5,7 @@
 #include "kds_s2000w_handler_opts.h"
 #include "kds_s2000w_debug.h"
 
+#define AUTOSTART_ALWAYS_ON 1
 #define COUNT_CUSTOM_OPTIONS 4
 
 extern json_object* resp_config;
@@ -267,8 +268,11 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf
 
                        break;
                case 9:
+                       int* autostart_value = (int*) value;
+                       *autostart_value = AUTOSTART_ALWAYS_ON;
                        value_object = json_object_object_get(config, "AutoStart");
-                       _write_int_value_to_json(value_object, value);
+                       _write_int_value_to_json(value_object, autostart_value);
+                       *info = RELOAD_OPTIONS;
                        break;
                case 10:
                        value_object = json_object_object_get(config, "ColorDropOut");
@@ -343,8 +347,11 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf
                        kds_s2000w_client_get_capabilities(resp);
                        json_object* capabilities = json_tokener_parse(resp->data);
                        json_object* default_values = json_object_object_get(capabilities, "Defaults");
+                       json_object* autostart = json_object_object_get(default_values, "AutoStart");
+                       json_object_set_int(autostart, AUTOSTART_ALWAYS_ON);
                        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 = NULL;