From 0388f59e0fc524ed53950ee33812e581d836f912 Mon Sep 17 00:00:00 2001 From: Arun Muthusamy <arun.muthusamy@inteno.se> Date: Thu, 7 Jun 2018 15:22:50 +0200 Subject: [PATCH] change return type xml to json type --- libmobile_hilink.c | 8 ++++++-- libmobile_hilink.h | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libmobile_hilink.c b/libmobile_hilink.c index c29480b..24d2c66 100644 --- a/libmobile_hilink.c +++ b/libmobile_hilink.c @@ -353,11 +353,15 @@ struct write_result *mobile_get_sms_count() } -struct write_result *mobile_get_language() +struct json_object *mobile_get_language() { char *api_url = "http://192.168.8.1/api/language/current-language"; + struct write_result *result; + + result = get_request(home_url, api_url); + + return xml_to_json_converter(result); - return get_request(home_url, api_url); } /* post calls */ diff --git a/libmobile_hilink.h b/libmobile_hilink.h index 71321a6..a4d0a7b 100644 --- a/libmobile_hilink.h +++ b/libmobile_hilink.h @@ -7,6 +7,7 @@ #include <string.h> #include <stdlib.h> #include <unistd.h> +#include "common.h" #define BUFFER_SIZE (256 * 1024) //256kb @@ -63,8 +64,7 @@ struct write_result *mobile_get_notification(); //SimDraft, LocalMax, SimMax, SimUsed, NewMsg struct write_result *mobile_get_sms_count(); -struct write_result *mobile_get_language(); - +struct json_object *mobile_get_language(); struct write_result *mobile_create_apn_profile(char *name, char *apn_name, char *username, char *password); struct write_result *mobile_set_apn_profile_default(char *name, char *apn_name, char *username, char *password); -- GitLab