From 2b6c0f063f479ff0de0945922c6bcb3f823234a1 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sat, 15 Sep 2018 20:08:58 -0700 Subject: 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 --- binding-bluetooth/bluetooth-api.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 */ }; -- cgit 1.2.3-korg