summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeonghoon Park <jh1979.park@samsung.com>2018-07-04 20:25:38 +0900
committerJeonghoon Park <jh1979.park@samsung.com>2018-07-04 20:25:38 +0900
commit0ca076b57d15a12f0f0e0c05bb92fe6e15c19341 (patch)
treec615f736e82820affb2fbb7662d84790291b45e4
parent44a4fb8430c0533ea43dd3abfcbed23ec9159d99 (diff)
downloadtizen-things-daemon-0ca076b57d15a12f0f0e0c05bb92fe6e15c19341.tar.gz
tizen-things-daemon-0ca076b57d15a12f0f0e0c05bb92fe6e15c19341.tar.bz2
tizen-things-daemon-0ca076b57d15a12f0f0e0c05bb92fe6e15c19341.zip
update report format
Change-Id: I7c63db4afd5828596480a4847e5be456517f95ff
-rw-r--r--daemon/src/ttd-build-json.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/daemon/src/ttd-build-json.c b/daemon/src/ttd-build-json.c
index 855cf45..c15820c 100644
--- a/daemon/src/ttd-build-json.c
+++ b/daemon/src/ttd-build-json.c
@@ -45,7 +45,7 @@ report format
"content" : {
"code" : 0(int),
"desc" : "xxxx"(string, optional),
- "data" : "xxxx"(string, optional)
+ "data" : "xxxx"(json object, optional)
}(json object)
}
*/
@@ -85,7 +85,11 @@ char *ttd_build_json_create_report(
json_object_object_add(content_object, "desc", tmp_object);
if (json_data) {
- tmp_object = json_object_new_string(json_data);
+ tmp_object = json_tokener_parse(json_data);
+ if (!tmp_object) {
+ _W("failed to parse report data - %s", json_data);
+ tmp_object = json_object_new_string(json_data);
+ }
json_object_object_add(content_object, "data", tmp_object);
}