summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-06-25 21:19:02 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-06-25 21:19:02 +0200
commit0fe1ff36dcc75149481d8071a1806c5408f70acc (patch)
tree1ea7b34e2a82033424ec63ebbcc6e16a79c82516
parentdbbef07d5d5e7c4d1c3eac2d6d1fd5f4f46268ce (diff)
parenteb3fb0866ea130ec0c15c868e1a5c806981195cc (diff)
Merge branch 'master' of github.com:iotbzh/audio-bindings
Moved to New AGL cmake build Templates
-rw-r--r--ALSA-afb/Alsa-SetGet.c4
-rw-r--r--HighLevel-afb/HighLevelBinding.c18
-rw-r--r--HighLevel-afb/HighLevelBinding.h4
-rw-r--r--Shared-Interface/audio-interface.c2
-rw-r--r--Shared-Interface/audio-interface.h3
5 files changed, 12 insertions, 19 deletions
diff --git a/ALSA-afb/Alsa-SetGet.c b/ALSA-afb/Alsa-SetGet.c
index 1f80d01..abf1a6a 100644
--- a/ALSA-afb/Alsa-SetGet.c
+++ b/ALSA-afb/Alsa-SetGet.c
@@ -925,7 +925,7 @@ PUBLIC void alsaSubcribe (struct afb_req request) {
// reach MAX_SND_CARD event registration
if (idxFree == -1) {
- afb_req_fail_f (request, "register-toomany", "Cannot register new event Maxcard==%devent name=%s", idx);
+ afb_req_fail_f (request, "register-toomany", "Cannot register new event Maxcard==%d", idx);
goto OnErrorExit;
}
@@ -967,7 +967,7 @@ PUBLIC void alsaSubcribe (struct afb_req request) {
// subscribe to binder event
err = afb_req_subscribe(request, evtHandle->afbevt);
if (err != 0) {
- afb_req_fail_f (request, "register-eventname", "Cannot subscribe binder event name=%s [invalid channel]", queryValues.devid, err);
+ afb_req_fail_f (request, "register-eventname", "Cannot subscribe binder event name=%s [invalid channel]", queryValues.devid);
goto OnErrorExit;
}
diff --git a/HighLevel-afb/HighLevelBinding.c b/HighLevel-afb/HighLevelBinding.c
index df5f2c3..07ed2fc 100644
--- a/HighLevel-afb/HighLevelBinding.c
+++ b/HighLevel-afb/HighLevelBinding.c
@@ -53,7 +53,7 @@ PUBLIC void audioLogicSetVol(struct afb_req request) {
const char *vol = afb_req_value(request, "vol");
if (vol == NULL) {
- afb_req_fail_f(request, "argument-missing", "vol=+-%[0,100] missing");
+ afb_req_fail_f(request, "argument-missing", "vol=+-%%[0,100] missing");
goto OnExit;
}
@@ -66,7 +66,7 @@ PUBLIC void audioLogicSetVol(struct afb_req request) {
break;
default:
- afb_req_fail_f(request, "value-invalid", "volume should be (+-%[0-100]xxx) vol=%s", vol);
+ afb_req_fail_f(request, "value-invalid", "volume should be (+-%%[0-100]xxx) vol=%s", vol);
goto OnExit;
}
@@ -106,7 +106,7 @@ PUBLIC void audioLogicMonitor(struct afb_req request) {
// get client context
AudioLogicCtxT *ctx = afb_req_context_get(request);
if (!ctx) {
- afb_req_fail_f(request, "ctx-notfound", "No Client Context HAL/getcontrol devid=[%] name=[%s]", ctx->devid, ctx->shortname);
+ afb_req_fail_f(request, "ctx-notfound", "No Client Context HAL/getcontrol devid=[%s] name=[%s]", ctx->devid, ctx->shortname);
goto OnExit;
}
@@ -154,14 +154,14 @@ STATIC void audioLogicOpenCB2(void *handle, int iserror, struct json_object *res
// get client context
AudioLogicCtxT *ctx = afb_req_context_get(request);
if (!ctx) {
- afb_req_fail_f(request, "ctx-notfound", "No Client Context HAL/getcontrol devid=[%] name=[%s]", ctx->devid, ctx->shortname);
+ afb_req_fail_f(request, "ctx-notfound", "No Client Context HAL/getcontrol devid=[%s] name=[%s]", ctx->devid, ctx->shortname);
goto OnExit;
}
// Get response from object
json_object_object_get_ex(result, "response", &response);
if (!response) {
- afb_req_fail_f(request, "response-notfound", "No Controls return from HAL/getcontrol devid=[%] name=[%s]", ctx->devid, ctx->shortname);
+ afb_req_fail_f(request, "response-notfound", "No Controls return from HAL/getcontrol devid=[%s] name=[%s]", ctx->devid, ctx->shortname);
goto OnExit;
}
@@ -169,13 +169,13 @@ STATIC void audioLogicOpenCB2(void *handle, int iserror, struct json_object *res
struct json_object *ctls;
json_object_object_get_ex(response, "ctls", &ctls);
if (!ctls) {
- afb_req_fail_f(request, "ctls-notfound", "No Controls return from HAL/getcontrol devid=[%] name=[%s]", ctx->devid, ctx->shortname);
+ afb_req_fail_f(request, "ctls-notfound", "No Controls return from HAL/getcontrol devid=[%s] name=[%s]", ctx->devid, ctx->shortname);
goto OnExit;
}
// make sure return controls have a valid type
if (json_object_get_type(ctls) != json_type_array) {
- afb_req_fail_f(request, "ctls-notarray", "Invalid Controls return from HAL/getcontrol devid=[%] name=[%s]", ctx->devid, ctx->shortname);
+ afb_req_fail_f(request, "ctls-notarray", "Invalid Controls return from HAL/getcontrol devid=[%s] name=[%s]", ctx->devid, ctx->shortname);
goto OnExit;
}
@@ -187,7 +187,7 @@ STATIC void audioLogicOpenCB2(void *handle, int iserror, struct json_object *res
ctl = json_object_array_get_idx(ctls, idx);
if (json_object_array_length(ctl) != 2) {
- afb_req_fail_f(request, "ctl-invalid", "Invalid Control return from HAL/getcontrol devid=[%] name=[%s] ctl=%s"
+ afb_req_fail_f(request, "ctl-invalid", "Invalid Control return from HAL/getcontrol devid=[%s] name=[%s] ctl=%s"
, ctx->devid, ctx->shortname, json_object_get_string(ctl));
goto OnExit;
}
@@ -266,7 +266,7 @@ STATIC void audioLogicOpenCB1(void *handle, int iserror, struct json_object *res
// sound card was find let's store keycontrols into client session
if (!ctx->halapi) {
- afb_req_fail_f(request, "hal-notfound", "No HAL found devid=[%] name=[%s]", ctx->devid, ctx->shortname);
+ afb_req_fail_f(request, "hal-notfound", "No HAL found devid=[%s] name=[%s]", ctx->devid, ctx->shortname);
goto OnExit;
}
diff --git a/HighLevel-afb/HighLevelBinding.h b/HighLevel-afb/HighLevelBinding.h
index a2ca61c..c1a0aef 100644
--- a/HighLevel-afb/HighLevelBinding.h
+++ b/HighLevel-afb/HighLevelBinding.h
@@ -18,10 +18,6 @@
#ifndef AUDIOLOGIC_H
#define AUDIOLOGIC_H
-#include <json-c/json.h>
-#include <afb/afb-binding.h>
-#include <afb/afb-service-itf.h>
-
#include "audio-interface.h"
// import from AlsaAfbBinding
diff --git a/Shared-Interface/audio-interface.c b/Shared-Interface/audio-interface.c
index a938c22..edaaf7f 100644
--- a/Shared-Interface/audio-interface.c
+++ b/Shared-Interface/audio-interface.c
@@ -18,8 +18,6 @@
#define _GNU_SOURCE // needed for vasprintf
#include <json-c/json.h>
-#include <afb/afb-binding.h>
-#include <afb/afb-service-itf.h>
#include <semaphore.h>
#include <string.h>
diff --git a/Shared-Interface/audio-interface.h b/Shared-Interface/audio-interface.h
index ffefbfc..24fcfaa 100644
--- a/Shared-Interface/audio-interface.h
+++ b/Shared-Interface/audio-interface.h
@@ -23,8 +23,8 @@
#define AUDIOCOMMON_H
#include <json-c/json.h>
+#define AFB_BINDING_VERSION 1
#include <afb/afb-binding.h>
-#include <afb/afb-service-itf.h>
#ifndef PUBLIC
#define PUBLIC
@@ -61,7 +61,6 @@ typedef enum {
} halCtlsEnumT;
PUBLIC int cbCheckResponse(struct afb_req request, int iserror, struct json_object *result) ;
-PUBLIC json_object* afb_service_call_sync(struct afb_service srvitf, struct afb_req request, char* api, char* verb, struct json_object* queryurl);
PUBLIC void pingtest(struct afb_req request);
#endif /* AUDIOCOMMON_H */