From 415d0eea2eb8a1dae47f6cadc73e4fd7675dd8c3 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Tue, 22 May 2018 15:34:10 +0200 Subject: Update to binder changes for bindings v3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bindings v3 are now allowed to return an object with errors. To enforce taking that change into account, the signature of the object changed. It implies some change in clients. The current patch makes a minimal change. Change-Id: I587b5b656d57e747bd4bb1d9f7fa97126211f891 Signed-off-by: José Bollo --- alsa-hook/PolicyAlsaHook.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/alsa-hook/PolicyAlsaHook.c b/alsa-hook/PolicyAlsaHook.c index 50c603b..3a48f83 100644 --- a/alsa-hook/PolicyAlsaHook.c +++ b/alsa-hook/PolicyAlsaHook.c @@ -230,11 +230,23 @@ static void OnFailureCB(void* UNUSED_ARG(ctx), void* handle, const char *status, sem_post (&afbClient->semaphore); } +#if defined(AFB_PROTO_WS_VERSION) && (AFB_PROTO_WS_VERSION >= 3) +static void OnReplyCB(void* ctx, void* handle, json_object* responseJ, const char *error, const char *info) { + if (error) + OnFailureCB(ctx, handle, error, info); + else + OnSuccessCB(ctx , handle, responseJ, info); +} +#endif /* the callback interface for pws */ static struct afb_proto_ws_client_itf itf = { +#if defined(AFB_PROTO_WS_VERSION) && (AFB_PROTO_WS_VERSION >= 3) + .on_reply = OnReplyCB, +#else .on_reply_success = OnSuccessCB, .on_reply_fail = OnFailureCB, +#endif .on_event_create = NULL, .on_event_remove = NULL, .on_event_subscribe = NULL, -- cgit 1.2.3-korg