{
json_object_put(resp_config);
resp_config = NULL;
+ response* resp = NULL;
- response* resp = kds_s2000w_client_response_init();
+ resp = kds_s2000w_client_response_init();
int result = kds_s2000w_client_get_option(h->sessionid, resp);
resp_config = json_tokener_parse(resp->data);
config = json_object_object_get(resp_config, "Configuration");
if (h->read_info->scan_started)
return;
- config = json_object_object_get(resp_config, "Configuration");
+ response* resp = NULL;
json_object* value_object = NULL;
+ json_object* capabilities = NULL;
+ json_object* default_values = NULL;
+ json_object* autostart = NULL;
+ json_object* default_config = NULL;
+
+ config = json_object_object_get(resp_config, "Configuration");
int autostart_value = AUTOSTART_ALWAYS_ON;
value_object = json_object_object_get(config, "AutoStart");
_write_int_value_to_json(value_object, value);
break;
case 23:
- response* resp = kds_s2000w_client_response_init();
+ resp = kds_s2000w_client_response_init();
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");
+ capabilities = json_tokener_parse(resp->data);
+ default_values = json_object_object_get(capabilities, "Defaults");
+ autostart = json_object_object_get(default_values, "AutoStart");
json_object_set_int(autostart, AUTOSTART_ALWAYS_ON);
- json_object* default_config = json_object_new_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);
}
const char* json_string = json_object_to_json_string_ext(resp_config, JSON_C_TO_STRING_PLAIN);
- response* resp = kds_s2000w_client_response_init();
+ resp = kds_s2000w_client_response_init();
resp->size = sizeof(char) * strlen(json_string);
resp->code = 0;
resp->data = realloc(resp->data, resp->size);