From bd62c29616c02f0e629ffa4d3ae6e6cc7506f992 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sat, 15 Sep 2018 22:48:11 -0700 Subject: binding: bluetooth: add version verb Report API as 2.0 to middleware + application clients Bug-AGL: SPEC-1630 Change-Id: I4ce889a06a0cd287af2d08068a59bbc7d359c20b Signed-off-by: Matt Ranostay --- binding/bluetooth-api.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c index 633bbd6..762a8c0 100644 --- a/binding/bluetooth-api.c +++ b/binding/bluetooth-api.c @@ -968,6 +968,15 @@ static void bluetooth_remove_device(afb_req_t request) json_object_put(jval); } +static void bluetooth_version(afb_req_t request) +{ + json_object *jresp = json_object_new_object(); + + json_object_object_add(jresp, "version", json_object_new_string("2.0")); + + afb_req_success(request, jresp, "Bluetooth - Binding version"); +} + static const struct afb_verb_v3 bluetooth_verbs[] = { { .verb = "subscribe", @@ -1019,6 +1028,11 @@ static const struct afb_verb_v3 bluetooth_verbs[] = { .session = AFB_SESSION_NONE, .callback = bluetooth_remove_device, .info = "Removed paired device", + }, { + .verb = "version", + .session = AFB_SESSION_NONE, + .callback = bluetooth_version, + .info = "Binding API version", }, { } /* marker for end of the array */ }; -- cgit 1.2.3-korg