diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-09-15 22:48:11 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-11-12 03:58:47 -0800 |
commit | bd62c29616c02f0e629ffa4d3ae6e6cc7506f992 (patch) | |
tree | 316cc067f84373889c12e506ea77c4aa4ce5e49d /binding | |
parent | 93f9937300ce2ae1f45d3362d6c1a3180e0743a8 (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.c | 14 |
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 */ }; |