aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-09-15 20:08:58 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-09-15 21:29:54 -0700
commit2b6c0f063f479ff0de0945922c6bcb3f823234a1 (patch)
treedbe767ca8ef6c8ab33ec9db28550ed35eabae28e
parentdd2d10a4c2d58f64c2eb7631e7429c255a89ae96 (diff)
binding: bluetooth: add version verb
Add version verb to allow middleware and application to know which verb schema to use in the future. Bug-AGL: SPEC-1736 Change-Id: Ie18871836b86cd5fed54e44ddf957e34d8e1b606 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--binding-bluetooth/bluetooth-api.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/binding-bluetooth/bluetooth-api.c b/binding-bluetooth/bluetooth-api.c
index dfe946c..cf6e427 100644
--- a/binding-bluetooth/bluetooth-api.c
+++ b/binding-bluetooth/bluetooth-api.c
@@ -841,6 +841,15 @@ static void bt_send_confirmation(struct afb_req request)
}
+static void bt_version(struct afb_req request)
+{
+ json_object *jresp = json_object_new_object();
+
+ json_object_object_add(jresp, "version", json_object_new_string("1.0"));
+
+ afb_req_success(request, jresp, "Bluetooth - Binding version");
+}
+
/*
* array of the verbs exported to afb-daemon
*/
@@ -862,6 +871,7 @@ static const struct afb_verb_v2 binding_verbs[]= {
{ .verb = "send_confirmation", .callback = bt_send_confirmation, .info = "Send Confirmation" },
{ .verb = "subscribe", .callback = subscribe, .info = "subscribes to the event of 'value'"},
{ .verb = "unsubscribe", .callback = unsubscribe, .info = "unsubscribes to the event of 'value'"},
+{ .verb = "version", .callback = bt_version, .info = "report the binder version API"},
{ } /* marker for end of the array */
};