From e6e12e15f86620aaf4ddb97dceaf15fe91f1e357 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Thu, 19 Apr 2018 18:21:10 -0700 Subject: binding: bluetooth: discovery_result response refactored Put the json array into a single entry map to make it consistant with other binding APIs and verbs. This also makes libqtappfw access for response data much easier Bug-AGL: SPEC-1385 Change-Id: I2eeb6ead1e386503a765dc1e252c969bb647eeee Signed-off-by: Matt Ranostay --- binding-bluetooth/bluetooth-api.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binding-bluetooth/bluetooth-api.c b/binding-bluetooth/bluetooth-api.c index 158c005..88b5832 100644 --- a/binding-bluetooth/bluetooth-api.c +++ b/binding-bluetooth/bluetooth-api.c @@ -384,6 +384,7 @@ static void bt_discovery_result (struct afb_req request) return; } + json_object *jresp = json_object_new_object(); json_object *my_array = json_object_new_array(); tmp = list; @@ -401,7 +402,9 @@ static void bt_discovery_result (struct afb_req request) adapter_devices_list_free(list); - afb_req_success(request, my_array, "BT - Scan Result is Displayed"); + json_object_object_add(jresp, "list", my_array); + + afb_req_success(request, jresp, "BT - Scan Result is Displayed"); } /**/ -- cgit 1.2.3-korg