summaryrefslogtreecommitdiffstats
path: root/binding-bluetooth/bluetooth-api.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-08-22 14:35:06 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-08-22 15:29:22 -0700
commitee0b6c81188c1b3a10b877e6244c186e65d9b8a1 (patch)
tree88e1b698d36ccc3e30c922c2bb29964b35c3ab18 /binding-bluetooth/bluetooth-api.c
parent2260e85751467db9c361346e5bea5bd6b41b1718 (diff)
binding: bluetooth: add verb to export paired device priorities
Add device_priorities verb to export paired device priorities in an array. Bug-AGL: SPEC-839 Change-Id: I83dc17a2a8f755235b0b35a12d2cae8388b69c85 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding-bluetooth/bluetooth-api.c')
-rw-r--r--binding-bluetooth/bluetooth-api.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/binding-bluetooth/bluetooth-api.c b/binding-bluetooth/bluetooth-api.c
index ed5fef8..3da59d9 100644
--- a/binding-bluetooth/bluetooth-api.c
+++ b/binding-bluetooth/bluetooth-api.c
@@ -567,6 +567,19 @@ static void bt_remove_device (struct afb_req request)
}
+static void bt_device_priorities_cb (json_object *array, gchar *str)
+{
+ json_object_array_add(array, json_object_new_string(str));
+}
+
+static void bt_device_priorities (struct afb_req request)
+{
+ json_object *jarray = json_object_new_array();
+
+ device_priority_list(&bt_device_priorities_cb, jarray);
+
+ afb_req_success(request, jarray, "Display paired device priority");
+}
/**/
static void bt_set_device_property (struct afb_req request)
@@ -836,6 +849,7 @@ static const struct afb_verb_v2 binding_verbs[]= {
{ .verb = "cancel_pair", .session = AFB_SESSION_NONE, .callback = bt_cancel_pairing, .info = "Cancel the pairing process" },
{ .verb = "connect", .session = AFB_SESSION_NONE, .callback = bt_connect, .info = "Connect to special device" },
{ .verb = "disconnect", .session = AFB_SESSION_NONE, .callback = bt_disconnect, .info = "Disconnect special device" },
+{ .verb = "device_priorities", .session = AFB_SESSION_NONE, .callback = bt_device_priorities, .info = "Get BT paired device priorites" },
{ .verb = "set_device_property", .session = AFB_SESSION_NONE, .callback = bt_set_device_property, .info = "Set special device property" },
{ .verb = "set_property", .session = AFB_SESSION_NONE, .callback = bt_set_property, .info = "Set Bluetooth property" },
{ .verb = "set_avrcp_controls", .session = AFB_SESSION_NONE, .callback = bt_set_avrcp_controls, .info = "Set Bluetooth AVRCP controls" },