json_object_put(resObj);
resObj = NULL;
+ kds_s2000w_client_response_free(resp);
+ resp = NULL;
printf("sessionid: %li\n", state->sessionid);
return state;
json_object_put(resObj);
resObj = NULL;
kds_s2000w_client_response_free(resp);
+ resp = NULL;
}
current_state* kds_s2000w_handler_current_state()
json_object* value_object = NULL;
switch(option) {
case 0:
+ resp = kds_s2000w_client_response_init();
int result = kds_s2000w_client_get_option(state->sessionid, resp);
resObj = json_tokener_parse(resp->data);
config = json_object_object_get(resObj, "Configuration");
int* int_value_ptr = (int*) value;
*int_value_ptr = json_object_object_length(config) + 3;
+ kds_s2000w_client_response_free(resp);
+ resp = NULL;
break;
case 2:
value_object = json_object_object_get(config, "DPI");
break;
}
- const char* json_string = json_object_to_json_string_ext(resObj, JSON_C_TO_STRING_PLAIN);
- resp->data = (char*) json_string;
- resp->size = sizeof(char) * strlen(json_string);
- resp->code = 0;
- kds_s2000w_client_set_option(state->sessionid, resp);
+ // TODO: send request
+ // const char* json_string = json_object_to_json_string_ext(resObj, JSON_C_TO_STRING_PLAIN);
+ // resp = kds_s2000w_client_response_init();
+ // resp->data = (char*) json_string;
+ // resp->size = sizeof(char) * strlen(json_string);
+ // resp->code = 0;
+ // kds_s2000w_client_set_option(state->sessionid, resp);
+ // kds_s2000w_client_response_free(resp);
}
void kds_s2000w_handler_set_option_auto(int option)