summaryrefslogtreecommitdiffstats
path: root/binding-bluetooth
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-09-13 13:05:50 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-09-14 18:36:05 +0000
commitd745897d39dd5ac1cd59b1299c9c3a594c5d4a87 (patch)
tree6a54365479626119a5404477a29499474fdf861f /binding-bluetooth
parentb1609fd13aedad83a95515d47a364266bcdf6ee2 (diff)
binding: bluetooth: add adapter parameter to JSON outputflounder_6.0.0flounder/6.0.06.0.0
Allow subscribers to get the respective devices adapter from a BlueZ path Bug-AGL: SPEC-1720 Change-Id: Ie7fc43558d386bb010f34e64e967c0bf0f054b45 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding-bluetooth')
-rw-r--r--binding-bluetooth/bluetooth-api.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/binding-bluetooth/bluetooth-api.c b/binding-bluetooth/bluetooth-api.c
index 8823b23..dfe946c 100644
--- a/binding-bluetooth/bluetooth-api.c
+++ b/binding-bluetooth/bluetooth-api.c
@@ -160,13 +160,17 @@ static json_object *new_json_object_from_device(struct btd_device *BDdevice, uns
{
if (BDdevice->path)
{
+ gchar **str;
+
jstring = json_object_new_string(BDdevice->path);
+ json_object_object_add(jresp, "Path", jstring);
+
+ str = g_strsplit(BDdevice->path, "/", 0);
+ jstring = json_object_new_string(str[3]);
+ g_strfreev(str);
+
+ json_object_object_add(jresp, "Adapter", jstring);
}
- else
- {
- jstring = json_object_new_string("");
- }
- json_object_object_add(jresp, "Path", jstring);
}
if (BD_ADDER & filter)