summaryrefslogtreecommitdiffstats
path: root/alsa-binding/Alsa-SetGet.c
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-07-19 17:22:00 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-07-20 11:39:37 +0000
commit7b20b115c4ec4b9c157d19d5154453f5c751a5d6 (patch)
tree3a56e02b4aaff0cc0bf205f27134d40a617dda59 /alsa-binding/Alsa-SetGet.c
parent2209293bec9ce0cff772dedbec326704f5a2ca42 (diff)
Use some app-fwk macros to support v2 and v3
Use some application framework macros to support both v2 and v3 compilation. Change-Id: I3051bbeff8788ea2c71545e5d253619d4749ff41 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'alsa-binding/Alsa-SetGet.c')
-rw-r--r--alsa-binding/Alsa-SetGet.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/alsa-binding/Alsa-SetGet.c b/alsa-binding/Alsa-SetGet.c
index 6983817..b0b8949 100644
--- a/alsa-binding/Alsa-SetGet.c
+++ b/alsa-binding/Alsa-SetGet.c
@@ -409,7 +409,11 @@ STATIC json_object* alsaCardProbe(const char *rqt, InfoGetT infoType) {
name = snd_ctl_card_info_get_name(cardinfo);
json_object_object_add(ctlDev, "name", json_object_new_string(name));
+#if(AFB_BINDING_VERSION == 3)
+ if (afb_api_wants_log_level(afbBindingV3root, AFB_SYSLOG_LEVEL_NOTICE)) {
+#else
if (afb_get_verbosity() >= AFB_VERBOSITY_LEVEL_NOTICE) {
+#endif
driver = snd_ctl_card_info_get_driver(cardinfo);
json_object_object_add(ctlDev, "driver", json_object_new_string(driver));
info = strdup(snd_ctl_card_info_get_longname(cardinfo));
@@ -426,7 +430,7 @@ STATIC json_object* alsaCardProbe(const char *rqt, InfoGetT infoType) {
// Loop on every potential Sound card and register active one
-PUBLIC void alsaGetInfo(afb_req request) {
+PUBLIC void alsaGetInfo(afb_req_t request) {
int card;
json_object *ctlDev, *ctlDevs;
char devid[32];
@@ -708,7 +712,7 @@ OnErrorExit:
// assign multiple control to the same value
-STATIC void alsaSetGetCtls(ActionSetGetT action, afb_req request) {
+STATIC void alsaSetGetCtls(ActionSetGetT action, afb_req_t request) {
ctlRequestT *ctlRequest;
const char *warmsg = NULL;
int err = 0, status = 0, done;
@@ -873,11 +877,11 @@ OnErrorExit:
return;
}
-PUBLIC void alsaGetCtls(afb_req request) {
+PUBLIC void alsaGetCtls(afb_req_t request) {
alsaSetGetCtls(ACTION_GET, request);
}
-PUBLIC void alsaSetCtls(afb_req request) {
+PUBLIC void alsaSetCtls(afb_req_t request) {
alsaSetGetCtls(ACTION_SET, request);
}