summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-09-15 22:48:11 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-11-23 08:49:14 -0800
commit2bde7e36883e79e2e31ae3e35bb77d2f075b7671 (patch)
treec905622472bce5835f41b2b195217a4f6e70d50e /binding
parentfb433aa5407795e864c2ff638d9e3d85fb6c297b (diff)
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 <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding')
-rw-r--r--binding/bluetooth-api.c14
1 files changed, 14 insertions, 0 deletions
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 */
};