break;
}
- // 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);
+ const char* json_string = json_object_to_json_string_ext(resObj, JSON_C_TO_STRING_PLAIN);
+ resp = kds_s2000w_client_response_init();
+ resp->size = sizeof(char) * strlen(json_string);
+ resp->code = 0;
+ resp->data = realloc(resp->data, resp->size);
+ resp->data = memcpy(resp->data, json_string, resp->size);
+ kds_s2000w_client_set_option(state->sessionid, resp);
+ kds_s2000w_client_response_free(resp);
+ resp = NULL;
}
void kds_s2000w_handler_set_option_auto(int option)