summaryrefslogtreecommitdiffstats
path: root/HAL-afb/HAL-interface
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-08-21 10:23:18 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-08-21 10:23:18 +0200
commit88d0b8c02eaaac8843f184e379fc5a19250295e5 (patch)
tree4893d2b5cb0fdbddf0357ebd7d32009e73856cec /HAL-afb/HAL-interface
parentba709f088f5a4718b7096003ab19083af4681155 (diff)
parentd51d083be8e34000cd00ce979445eacb45a16e97 (diff)
Merge branch 'fulup-dev'
Change-Id: I7dc6859767ac5919cf383e33bd2cf3a98698d9b4
Diffstat (limited to 'HAL-afb/HAL-interface')
-rw-r--r--HAL-afb/HAL-interface/hal-interface.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/HAL-afb/HAL-interface/hal-interface.c b/HAL-afb/HAL-interface/hal-interface.c
index 4d86504..0abe67e 100644
--- a/HAL-afb/HAL-interface/hal-interface.c
+++ b/HAL-afb/HAL-interface/hal-interface.c
@@ -44,7 +44,7 @@ STATIC int halCtlStringToIndex(const char* label) {
alsaHalMapT *halCtls = halSndCard->ctls;
for (int idx = 0; halCtls[idx].tag != EndHalCrlTag; idx++) {
- if (halCtls[idx].label && !strcmp(halCtls[idx].label, label)) return idx;
+ if (halCtls[idx].label && !strcasecmp(halCtls[idx].label, label)) return idx;
}
// not found
@@ -502,11 +502,12 @@ PUBLIC int halServiceInit(const char *apiPrefix, alsaHalSndCardT *alsaHalSndCard
json_object *ctlJ;
// Try to find best equivalent label for tag
- if (halCtls[idx].tag >StartHalCrlTag && halCtls[idx].tag < EndHalCrlTag && halCtls[idx].label != NULL) {
+ if (halCtls[idx].tag >StartHalCrlTag && halCtls[idx].tag < EndHalCrlTag && halCtlsLabels[halCtls[idx].tag] != NULL) {
halCtls[idx].label = halCtlsLabels[halCtls[idx].tag];
} else {
if (halCtls[idx].ctl.name) halCtls[idx].label=halCtls[idx].ctl.name;
else if (halCtls[idx].info) halCtls[idx].label=halCtls[idx].info;
+ else halCtls[idx].label="NoHalCttNameSet";
}
ctlJ = json_object_new_object();
@@ -617,9 +618,9 @@ PUBLIC void halServiceEvent(const char *evtname, json_object *eventJ) {
PUBLIC afb_verb_v2 halServiceApi[] = {
/* VERB'S NAME FUNCTION TO CALL SHORT DESCRIPTION */
{ .verb = "ping", .callback = pingtest, .info = "ping test for API"},
- { .verb = "ctl-list", .callback = halListCtls, .info = "List AGL normalised Sound Controls"},
- { .verb = "ctl-get", .callback = halGetCtls, .info = "Get one/many sound controls"},
- { .verb = "ctl-set", .callback = halSetCtls, .info = "Set one/many sound controls"},
- { .verb = "evt-sub", .callback = halSubscribe, .info = "Subscribe to HAL events"},
+ { .verb = "ctllist", .callback = halListCtls, .info = "List AGL normalised Sound Controls"},
+ { .verb = "ctlget", .callback = halGetCtls, .info = "Get one/many sound controls"},
+ { .verb = "ctlset", .callback = halSetCtls, .info = "Set one/many sound controls"},
+ { .verb = "evtsub", .callback = halSubscribe, .info = "Subscribe to HAL events"},
{ .verb = NULL} /* marker for end of the array */
};