aboutsummaryrefslogtreecommitdiffstats
path: root/alsa-hook
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-05-22 15:34:10 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-05-24 11:07:30 +0200
commit415d0eea2eb8a1dae47f6cadc73e4fd7675dd8c3 (patch)
treed23baa78f98a26dbd51742abf92b58a6d7b10fdc /alsa-hook
parentfb033078316ffaa895af251a2eec9685ba764863 (diff)
Update to binder changes for bindings v3
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 <jose.bollo@iot.bzh>
Diffstat (limited to 'alsa-hook')
-rw-r--r--alsa-hook/PolicyAlsaHook.c12
1 files changed, 12 insertions, 0 deletions
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,