From 66c594fdc40eb745bed177187b409e938736101b Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Fri, 13 Jul 2018 16:34:56 -0700 Subject: binding: nfc: convert binding to afb version 3 In order to use some of the features of v3 we need to update the data structures naming, and function parameters. Change-Id: I6c217a8f4c28053c838af9f324b1504a3e1cbf71 Signed-off-by: Matt Ranostay --- binding/afm-nfc-binding.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'binding/afm-nfc-binding.c') diff --git a/binding/afm-nfc-binding.c b/binding/afm-nfc-binding.c index e27a18c..5820eae 100644 --- a/binding/afm-nfc-binding.c +++ b/binding/afm-nfc-binding.c @@ -31,14 +31,14 @@ #include #include -#define AFB_BINDING_VERSION 2 +#define AFB_BINDING_VERSION 3 #include #include "afm-nfc-common.h" #define WAIT_FOR_REMOVE(dev) { while (0 == nfc_initiator_target_is_present(dev, NULL)) {} } -static struct afb_event presence_event; +static afb_event_t presence_event; static char *current_uid = NULL; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -157,7 +157,7 @@ static int init() return -ENODEV; } -static void subscribe(struct afb_req request) +static void subscribe(afb_req_t request) { const char *value = afb_req_value(request, "value"); @@ -176,7 +176,7 @@ static void subscribe(struct afb_req request) afb_req_fail(request, "failed", "Invalid event"); } -static void unsubscribe(struct afb_req request) +static void unsubscribe(afb_req_t request) { const char *value = afb_req_value(request, "value"); @@ -189,7 +189,7 @@ static void unsubscribe(struct afb_req request) afb_req_fail(request, "failed", "Invalid event"); } -static const struct afb_verb_v2 binding_verbs[] = { +static const struct afb_verb_v3 binding_verbs[] = { { .verb = "subscribe", .callback = subscribe, .info = "Subscribe to NFC events" }, { .verb = "unsubscribe", .callback = unsubscribe, .info = "Unsubscribe to NFC events" }, { } @@ -198,7 +198,7 @@ static const struct afb_verb_v2 binding_verbs[] = { /* * binder API description */ -const struct afb_binding_v2 afbBindingV2 = { +const struct afb_binding_v3 afbBindingV3 = { .api = "nfc", .specification = "NFC service API", .verbs = binding_verbs, -- cgit 1.2.3-korg