#include "kds_s2000w_debug.h"
json_object* resp_config = NULL;
-json_object* config = NULL;
void _get_current_metadata(handler* h)
{
json_object* metadataResp = NULL;
json_object* metadata = NULL;
json_object* mdata_value = NULL;
+ json_object* config = NULL;
blobdata* jpg_image = NULL;
blobdata* pnm_image = NULL;
response* resp = NULL;
json_object_put(metadataResp);
metadata = NULL;
+ config = json_object_object_get(resp_config, "Configuration");
metadata = json_object_object_get(config, "ColorMode");
const char* color_value = json_object_get_string(metadata);
mdata_value = NULL;
#define COUNT_CUSTOM_OPTIONS 2
extern json_object* resp_config;
-extern json_object* config;
void _write_string_value(json_object* value_object, void* value)
{
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 (result != 0 || resp->code != 200) {
debug_printf_int(ERROR, "load options response code", resp->code);
void kds_s2000w_handler_get_option(handler* h, int option, void* value, int* info)
{
- config = json_object_object_get(resp_config, "Configuration");
+ json_object* config = NULL;
json_object* value_object = NULL;
+ if (resp_config != NULL)
+ config = json_object_object_get(resp_config, "Configuration");
+
switch(option) {
case 0:
_load_options(h);
+ config = json_object_object_get(resp_config, "Configuration");
int* int_value_ptr = (int*) value;
*int_value_ptr = json_object_object_length(config) + COUNT_CUSTOM_OPTIONS;
break;
json_object* default_values = NULL;
json_object* autostart = NULL;
json_object* default_config = NULL;
+ json_object* config = NULL;
config = json_object_object_get(resp_config, "Configuration");