aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.c44
-rw-r--r--Shared-Interface/audio-interface.h3
5 files changed, 12 insertions, 61 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 c1c4054..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>
@@ -54,48 +52,6 @@ OnErrorExit:
}
-// This function should be part of Generic AGL Framework
-PUBLIC json_object* afb_service_call_sync(struct afb_service srvitf, struct afb_req request, char* api, char* verb, struct json_object* queryurl) {
- json_object* response = NULL;
- int status = 0;
- sem_t semid;
-
- // Nested procedure are allow in GNU and allow us to keep caller stack valid
-
- void callback(void *handle, int iserror, struct json_object *result) {
-
- // Process Basic Error
- if (!cbCheckResponse(request, iserror, result)) {
- status = -1;
- goto OnExitCB;
- }
-
- // 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 alsa/getcontrol result=[%s]", json_object_get_string(result));
- goto OnExitCB;
- }
-
-OnExitCB:
- sem_post(&semid);
- }
-
- // Create an exclusive semaphore
- status = sem_init(&semid, 0, 0);
- if (status < 0) {
- afb_req_fail_f(request, "error:seminit", "Fail to allocate semaphore err=[%s]", strerror(status));
- goto OnExit;
- }
-
- // Call service and wait for call back to finish before moving any further
- afb_service_call(srvitf, api, verb, queryurl, callback, NULL);
- sem_wait(&semid);
-
-OnExit:
- return (response);
-}
-
PUBLIC void pingtest(struct afb_req request) {
json_object *query = afb_req_json(request);
afb_req_success(request, query, NULL);
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 */