aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-08-16 10:49:51 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-08-16 10:49:51 +0200
commit4ca8fd4015479fa758a789d137a693c30fec8cae (patch)
tree45cac25de622ded5802f69f71ce958d3633ab22a
parent716d28f99637d6f2b8eb2758c2da41da67b8027c (diff)
Moved FileConfigScan to AudioCommon and Documentation
-rw-r--r--Alsa-Plugin/Alsa-Policy-Hook/PolicyHookCb.c135
-rw-r--r--Alsa-Plugin/Alsa-Policy-Hook/README.md22
-rw-r--r--Alsa-Plugin/_Alsa-Hal-plugin/README.md4
-rw-r--r--Audio-Common/CMakeLists.txt2
-rw-r--r--Audio-Common/audio-common.h3
-rw-r--r--Audio-Common/filescan-utils.c (renamed from Controler-afb/ctl-misc.c)1
-rw-r--r--Audio-Common/filescan-utils.h41
-rw-r--r--Controler-afb/CMakeLists.txt3
-rw-r--r--Controler-afb/README.md234
-rw-r--r--Controler-afb/ctl-apidef.h71
-rw-r--r--Controler-afb/ctl-apidef.json48
-rw-r--r--Controler-afb/ctl-binding.h12
-rw-r--r--Controler-afb/ctl-dispatch.c1
-rw-r--r--Controler-afb/ctl-events.c2
-rw-r--r--Controler-afb/ctl-lua.c117
-rw-r--r--README.md5
-rw-r--r--conf.d/project/config.d/onload-audio-control.json28
-rw-r--r--conf.d/project/lua.d/onload-audio-controls.lua23
-rw-r--r--htdocs/audio-control.html2
-rw-r--r--nbproject/configurations.xml372
-rw-r--r--nbproject/project.xml3
21 files changed, 830 insertions, 299 deletions
diff --git a/Alsa-Plugin/Alsa-Policy-Hook/PolicyHookCb.c b/Alsa-Plugin/Alsa-Policy-Hook/PolicyHookCb.c
index 3b52f5b..7c85e22 100644
--- a/Alsa-Plugin/Alsa-Policy-Hook/PolicyHookCb.c
+++ b/Alsa-Plugin/Alsa-Policy-Hook/PolicyHookCb.c
@@ -50,6 +50,7 @@
// this should be more than enough
#define MAX_API_CALL 10
+#define MAX_EVT_CALL 10
// timeout in ms
#define REQUEST_DEFAULT_TIMEOUT 100
@@ -73,6 +74,11 @@ typedef struct {
} afbRequestT;
typedef struct {
+ const char *name;
+ int signal;
+} afbEventT;
+
+typedef struct {
snd_pcm_t *pcm;
const char *uri;
struct afb_wsj1 *wsj1;
@@ -82,6 +88,7 @@ typedef struct {
int count;
int error;
afbRequestT **request;
+ afbEventT **event;
} afbClientT;
@@ -117,81 +124,40 @@ typedef enum {
HOOK_CLOSE,
} hookActionT;
-// supported action
-typedef enum {
- ACTION_PAUSE,
- ACTION_START,
- ACTION_STOP,
- ACTION_RESUME,
-
- ACTION_NONE
-} evtActionEnumT;
-
-// action label/enum map
-const char *evtActionLabels[] ={
- [ACTION_PAUSE] = "pause",
- [ACTION_START] = "start",
- [ACTION_STOP] = "stop",
- [ACTION_RESUME]= "resume",
-
- [ACTION_NONE]=NULL
-};
-
-static evtActionEnumT getActionEnum (const char *label) {
- int idx;
-
- if (!label) return ACTION_NONE;
-
- for (idx = 0; evtActionLabels[idx] != NULL; idx++) {
- if (! strcmp(evtActionLabels[idx], label)) break;
- }
-
- if (evtActionLabels[idx]) return idx;
- else return ACTION_NONE;
-}
void OnEventCB(void *handle, const char *event, struct afb_wsj1_msg *msg) {
afbClientT *afbClient = (afbClientT*) handle;
+ afbEventT **afbEvent = afbClient->event;
json_object *eventJ, *tmpJ, *dataJ;
- const char *action;
- int err, value, done;
-
+ const char *label;
+ int value, done, index;
eventJ = afb_wsj1_msg_object_j(msg);
done= json_object_object_get_ex(eventJ,"data", &dataJ);
if (!done) {
- SNDERR ("PCM_HOOK: uri=%s empty event action", afbClient->uri);
+ SNDERR ("PCM_HOOK: uri=%s empty event label", afbClient->uri);
goto OnErrorExit;
}
- json_object_object_get_ex(dataJ,"action", &tmpJ);
- action=json_object_get_string(tmpJ);
+ json_object_object_get_ex(dataJ,"signal", &tmpJ);
+ label=json_object_get_string(tmpJ);
json_object_object_get_ex(dataJ,"value", &tmpJ);
value=json_object_get_int(tmpJ);
- switch (getActionEnum(action)) {
- case ACTION_PAUSE:
- err = snd_pcm_pause (afbClient->pcm, value);
- if (err < 0) SNDERR ("PCM_HOOK: Fail to pause value=%d\n", value);
- break;
-
- case ACTION_STOP:
- err = snd_pcm_drop (afbClient->pcm);
- if (err < 0) SNDERR ("PCM_HOOK: Fail to close\n");
- break;
-
- case ACTION_START:
- err = snd_pcm_resume (afbClient->pcm);
- if (err < 0) SNDERR ("PCM_HOOK: Fail to start\n");
- break;
-
- default:
- SNDERR ("PCM_HOOK: Unsupported Event uri=%s action=%s", afbClient->uri, action);
- goto OnErrorExit;
+ for (index=0; afbEvent[index]!= NULL; index++) {
+ if (!strcmp(afbEvent[index]->name, label)) break;
}
- if (afbClient->verbose) printf("ON-EVENT action=%s value=%d\n", action, value);
+ if (!afbEvent[index] || !afbEvent[index]->signal) {
+ SNDERR ("PCM_HOOK: Unsupported uri=%s label=%s", afbClient->uri, label);
+ return;
+ }
+
+ // send signal to self process
+ kill (getpid(), afbEvent[index]->signal);
+
+ if (afbClient->verbose) printf("ON-EVENT label=%s signal=%d\n", label, value);
return;
OnErrorExit:
@@ -349,11 +315,11 @@ OnErrorExit:
// Function call when Plugin PCM is OPEN
int PLUGIN_ENTRY_POINT (snd_pcm_t *pcm, snd_config_t *conf) {
- afbRequestT **afbRequest;
snd_pcm_hook_t *h_close = NULL;
snd_config_iterator_t it, next;
afbClientT *afbClient = malloc(sizeof (afbClientT));
- afbRequest = malloc(MAX_API_CALL * sizeof (afbRequestT));
+ afbRequestT **afbRequest = malloc(MAX_API_CALL * sizeof(afbRequestT*));
+ afbEventT **afbEvent= malloc(MAX_EVT_CALL * sizeof(afbEventT*));
int err;
// start populating client handle
@@ -415,7 +381,7 @@ int PLUGIN_ENTRY_POINT (snd_pcm_t *pcm, snd_config_t *conf) {
ctype = snd_config_get_type(ctlconfig);
if (ctype != SND_CONFIG_TYPE_COMPOUND) {
snd_config_get_string(node, &callConf);
- SNDERR("Invalid call element for %s", callLabel);
+ SNDERR("Invalid call element for %s value=%s", callLabel, callConf);
goto OnErrorExit;
}
@@ -490,6 +456,53 @@ int PLUGIN_ENTRY_POINT (snd_pcm_t *pcm, snd_config_t *conf) {
}
continue;
}
+ if (strcmp(id, "event") == 0) {
+ const char *callConf, *callLabel;
+ snd_config_type_t ctype;
+ snd_config_iterator_t currentCall, follow;
+ int callCount=0;
+
+ ctype = snd_config_get_type(node);
+ if (ctype != SND_CONFIG_TYPE_COMPOUND) {
+ snd_config_get_string(node, &callConf);
+ SNDERR("Invalid compound type for %s", callConf);
+ goto OnErrorExit;
+ }
+
+
+ // loop on each call
+ snd_config_for_each(currentCall, follow, node) {
+ snd_config_t *ctlconfig = snd_config_iterator_entry(currentCall);
+ long sigval;
+
+ // ignore empty line
+ if (snd_config_get_id(ctlconfig, &callLabel) < 0) continue;
+
+ // each clt should be a valid config compound
+ ctype = snd_config_get_type(ctlconfig);
+ if (ctype != SND_CONFIG_TYPE_INTEGER) {
+ snd_config_get_string(ctlconfig, &callConf);
+ SNDERR("Invalid signal number for %s value=%s", callLabel, callConf);
+ goto OnErrorExit;
+ }
+
+ // allocate an empty call request
+ snd_config_get_integer(ctlconfig, &sigval);
+ afbEvent[callCount] = calloc(1, sizeof (afbEventT));
+ afbEvent[callCount]->name=strdup(callLabel);
+ afbEvent[callCount]->signal= (int)sigval;
+
+ // move to next call if any
+ callCount ++;
+ if (callCount == MAX_EVT_CALL) {
+ SNDERR("Too Many call MAX_EVT_CALL=%d", MAX_EVT_CALL);
+ goto OnErrorExit;
+ }
+ afbEvent[callCount]=NULL; // afbEvent array is NULL terminated
+
+ }
+ continue;
+ }
}
if (afbClient->verbose) fprintf(stdout, "\nAlsaHook Install Start PCM=%s URI=%s\n", snd_pcm_name(afbClient->pcm), afbClient->uri);
diff --git a/Alsa-Plugin/Alsa-Policy-Hook/README.md b/Alsa-Plugin/Alsa-Policy-Hook/README.md
index 537418d..e3f42fa 100644
--- a/Alsa-Plugin/Alsa-Policy-Hook/README.md
+++ b/Alsa-Plugin/Alsa-Policy-Hook/README.md
@@ -1,7 +1,7 @@
Alsa-Hook-Plugin
Object: Provide a Hook on Alsa PCM to check permission again AGL Advance Audio Agent
-Status: Working Proof of Concept
+Status: Release Candidate
Author: Fulup Ar Foll fulup@iot.bzh
Date : August-2017
@@ -39,21 +39,21 @@ pcm.MyNavigationHook {
uri "ws://localhost:1234/api?token='audio-agent-token'"
request {
# Request autorisation to write on navigation
- RequestNavigation {
+ navigation-ctl {
api "control"
- verb "navigation"
+ verb "request"
}
- # subscribe to Audio Agent Event
- SubscriveEvents {
+ # subscribe to Audio Agent Event map them to signal
+ subscribe-evt {
api "control"
verb "monitor"
}
- # force PCM stop after 10s
- TestAutoStop {
- api "control"
- verb "event_test"
- query "{'label':'stop', 'delay':10000}"
- }
+ }
+ # map event reception to self generated signal
+ event {
+ pause 30
+ resume 31
+ stop 3
}
}
}
diff --git a/Alsa-Plugin/_Alsa-Hal-plugin/README.md b/Alsa-Plugin/_Alsa-Hal-plugin/README.md
index 1c1e7a2..a0d4350 100644
--- a/Alsa-Plugin/_Alsa-Hal-plugin/README.md
+++ b/Alsa-Plugin/_Alsa-Hal-plugin/README.md
@@ -1,7 +1,7 @@
Hal-Plugin
-Object: provide an ALSA a HAL (Hardware Abstraction Layer) to automotive sound cards
-Status: Current version is proof of concept and not a usable product
+Object: Add virtual soft control to sound card
+Status: Proof of concept and not a usable product
Author: Fulup Ar Foll
Date : June-2017
diff --git a/Audio-Common/CMakeLists.txt b/Audio-Common/CMakeLists.txt
index 7544fe6..bd3f344 100644
--- a/Audio-Common/CMakeLists.txt
+++ b/Audio-Common/CMakeLists.txt
@@ -20,7 +20,7 @@
PROJECT_TARGET_ADD(audio-common)
# Define targets
- ADD_LIBRARY(${TARGET_NAME} STATIC audio-common.c wrap-json.c)
+ ADD_LIBRARY(${TARGET_NAME} STATIC audio-common.c wrap-json.c filescan-utils)
# Library properties
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
diff --git a/Audio-Common/audio-common.h b/Audio-Common/audio-common.h
index e7057d3..0a68eb3 100644
--- a/Audio-Common/audio-common.h
+++ b/Audio-Common/audio-common.h
@@ -25,6 +25,8 @@
#define AFB_BINDING_VERSION 2
#include <afb/afb-binding.h>
#include <json-c/json.h>
+#include "filescan-utils.h"
+#include "wrap-json.h"
// Waiting for official macro from José
#define AFB_GET_VERBOSITY afb_get_verbosity_v2()
@@ -34,6 +36,7 @@
#endif
#define STATIC static
+
// Soft control have dynamically allocated numid
#define CTL_AUTO -1
diff --git a/Controler-afb/ctl-misc.c b/Audio-Common/filescan-utils.c
index 773e8f9..9fa121b 100644
--- a/Controler-afb/ctl-misc.c
+++ b/Audio-Common/filescan-utils.c
@@ -23,7 +23,6 @@
#include <dirent.h>
#include "audio-common.h"
-#include "ctl-binding.h"
diff --git a/Audio-Common/filescan-utils.h b/Audio-Common/filescan-utils.h
new file mode 100644
index 0000000..eba504e
--- /dev/null
+++ b/Audio-Common/filescan-utils.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2016 "IoT.bzh"
+ * Author Fulup Ar Foll <fulup@iot.bzh>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * reference:
+ * amixer contents; amixer controls;
+ * http://www.tldp.org/HOWTO/Alsa-sound-6.html
+ */
+
+#ifndef FILESCAN_UTILS_H
+#define FILESCAN_UTILS_H
+
+#ifndef PUBLIC
+ #define PUBLIC
+#endif
+#define STATIC static
+
+// ctl-misc.c
+typedef enum {
+ CTL_SCAN_FLAT=0,
+ CTL_SCAN_RECURSIVE=1,
+} CtlScanDirModeT;
+
+PUBLIC const char *GetMidleName(const char*name);
+PUBLIC const char *GetBinderName();
+PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext);
+
+#endif /* FILESCAN_UTILS_H */
+
diff --git a/Controler-afb/CMakeLists.txt b/Controler-afb/CMakeLists.txt
index 4fb97b2..78e66c8 100644
--- a/Controler-afb/CMakeLists.txt
+++ b/Controler-afb/CMakeLists.txt
@@ -33,7 +33,7 @@ endmacro(SET_TARGET_GENSKEL)
PROJECT_TARGET_ADD(control-afb)
# Define project Targets
- ADD_LIBRARY(${TARGET_NAME} MODULE ctl-binding.c ctl-events.c ctl-dispatch.c ctl-lua.c ctl-misc.c)
+ ADD_LIBRARY(${TARGET_NAME} MODULE ctl-binding.c ctl-events.c ctl-dispatch.c ctl-lua.c)
# Generate API-v2 hat from OpenAPI json definition
SET_TARGET_GENSKEL(${TARGET_NAME} ctl-apidef)
@@ -70,6 +70,7 @@ PROJECT_TARGET_ADD(audio-plugin-sample)
# Library dependencies (include updates automatically)
TARGET_LINK_LIBRARIES(${TARGET_NAME}
+ audio-common
${link_libraries}
)
diff --git a/Controler-afb/README.md b/Controler-afb/README.md
new file mode 100644
index 0000000..3274ede
--- /dev/null
+++ b/Controler-afb/README.md
@@ -0,0 +1,234 @@
+Controler AAAA(AGL Advance Audio Controler) and more.
+------------------------------------------------------------
+
+ * Object: Generic Controler to handle Policy,Small Business Logic, Glue in between components, ...
+ * Status: Release Candidate
+ * Author: Fulup Ar Foll fulup@iot.bzh
+ * Date : August-2017
+
+## Functionalities:
+ - Create an application dedicate controller from a JSON config file
+ - Each controls (eg: navigation, multimedia, ...) is a suite of actions. When all actions succeed control is granted, if one fail control acces is denied.
+ - Actions can either be:
+ + Invocation to an other binding API, either internal or external (eg: a policy service, Alsa UCM, ...)
+ + C routines from a user provider plugin (eg: policy routine, proprietary code, ...)
+ + LUA script function. LUA provides access to every AGL appfw functionalities and can be extended from C user provided plugins.
+
+## Installation
+ - Controler is a native part of AGL Advance Audio Framework but may be used independently with any other service or application binder.
+ - Dependencies: the only dependencies are audio-common for JSON-WRAP and Filescan-utils capabilities.
+ - Controler relies on LUA-5.3, when not needed LUA might be removed at compilation time.
+
+## Config
+
+Configuration is loaded dynamically during startup time. The controller scans CONTROL_CONFIG_PATH for a file corresponding to pattern
+"onload-bindername-xxxxx.json". When controller runs within AAAA binder it searches for "onload-audio-xxxx.json". First file found in the path the loaded
+any other files corresponding to the same pather are ignored and only generate a warning.
+
+Each bloc in the configuration file are defined with
+ * label: must be provided is used either for debugging or as input for the action (eg: signal name, control name, ...)
+ * info: optional used for documentation purpose only
+
+### Config is organised in 4 sections:
+
+ * metadata
+ * onload defines the set of action to be executed at startup time
+ * control defines the set of controls with corresponding actions
+ * event define the set of actions to be executed when receiving a given signal
+
+### Metadata
+
+As today matadata is only used for documentation purpose.
+ * label + version mandatory
+ * info optional
+
+### OnLoad section
+
+Defines startup time configuration. Onload may provide multiple initialisation profiles, each with a different label.
+ * label is mandatory. Label is used to select onload profile at initialisation through DispatchOneOnLoad("onload-label") API;
+ * info is optional
+ * plugin provides optional unique plugin name. Plugin should follow "onload-bindername-xxxxx.ctlso" patern
+ and are search into CONTROL_PLUGIN_PATH. When defined controller will execute user provided function context=CTLP_ONLOAD(label,version,info).
+ The context returned by this routine is provided back to any C routines call later by the controller.
+ * lua2c list of LUA commands shipped with provided plugin.
+ * require list of binding that should be initialised before the controller starts. Note that some listed requirer binding might be absent,
+ nevertheless any present binding from this list will be started before controller binding, missing ones generate a warning.
+ * action the list of action to execute during loadtime. Any failure in action will prevent controller binding from starting.
+
+### Control section
+
+Defines a list of controls that are accessible through (api="control", verb="request", control="control-label").
+
+ * label mandatory
+ * info optional
+ * privileges needed privileges to request this control
+ * action the list of actions
+
+### Event section
+
+Defines a list of actions to be executed on event reception. Even can do anything a controller can (change state,
+send back signal, ...) eg: if a controller subscribes to vehicule speed, then speed-event may ajust master-volume to speed.
+
+ * label mandatory
+ * info optional
+ * action the list of actions
+
+### Actions Categories
+
+Controler support tree categories of actions. Each action return a status status where 0=success and 1=failure.
+ * AppFw API, Provides a generic model to request other bindings. Requested binding can be local (eg: ALSA/UCM) or
+ external (eg: vehicle signalling).
+ * api provides requested binding API name
+ * verb provides verb to requested binding
+ * args optionally provides a jsonc object for targeted binding API. Note that 'args' are statically defined
+ in JSON configuration file. Controler client may also provided its own arguments from the query list. Targeted
+ binding receives both arguments defined in the config file and the argument provided by controller client.
+ * C-API, when defined in the onload section, the plugin may provided C native API with CTLP-CAPI(apiname, label, args, query, context).
+ Plugin may also create LUA command with CTLP-LUA2C(LuaFuncName, label, args, query, context). Where args+query are JSONC object
+ and context the value return from CTLP_ONLOAD function. Any missing value is set to NULL.
+ * LUA-API, when compiled with LUA option, the controller support action defined directly in LUA script. During "onload" phase the
+ controller search in CONTROL_LUA_PATH file with pattern "onload-bindername-xxxx.lua". Any file corresponding to this pattern
+ is automatically loaded. Any function defined in those LUA script can be called through a controller action. LUA functions receive
+ three parameters (label, args, query).
+
+## Config Sample
+
+Here after a simple configuration sample.
+
+```
+{
+ "$schema": "ToBeDone",
+ "metadata": {
+ "label": "sample-audio-control",
+ "info": "Provide Default Audio Policy for Multimedia, Navigation and Emergency",
+ "version": "1.0"
+ },
+ "onload": [{
+ "label": "onload-default",
+ "info": "onload initialisation config",
+ "plugin": "ctl-audio-plugin-sample.ctlso",
+ "require": ["intel-hda", "jabra-usb", "scarlett-usb"],
+ "actions": [
+ {
+ "label": "onload-sample-cb",
+ "info": "Call control sharelib install entrypoint",
+ "callback": "SamplePolicyInit",
+ "args": {
+ "arg1": "first_arg",
+ "nextarg": "second arg value"
+ }
+ }, {
+ "label": "onload-sample-api",
+ "info": "Assert AlsaCore Presence",
+ "api": "alsacore",
+ "verb": "ping",
+ "args": "test"
+ }, {
+ "label": "onload-hal-lua",
+ "info": "Load avaliable HALs",
+ "lua": "Audio_Init_Hal"
+ }
+ ]
+ }],
+ "controls":
+ [
+ {
+ "label": "multimedia",
+ "actions": {
+ "label": "multimedia-control-lua",
+ "info": "Call Lua Script function Test_Lua_Engin",
+ "lua": "Audio_Set_Multimedia"
+ }
+ }, {
+ "label": "navigation",
+ "actions": {
+ "label": "navigation-control-lua",
+ "info": "Call Lua Script to set Navigation",
+ "lua": "Audio_Set_Navigation"
+ }
+ }, {
+ "label": "emergency",
+ "actions": {
+ "label": "emergency-control-ucm",
+ "lua": "Audio_Set_Emergency"
+ }
+ }, {
+ "label": "multi-step-sample",
+ "info" : "all actions must succeed for control to be accepted",
+ "actions": [{
+ "label": "multimedia-control-cb",
+ "info": "Call Sharelib Sample Callback",
+ "callback": "sampleControlNavigation",
+ "args": {
+ "arg1": "snoopy",
+ "arg2": "toto"
+ }
+ }, {
+ "label": "navigation-control-ucm",
+ "api": "alsacore",
+ "verb": "ping",
+ "args": {
+ "test": "navigation"
+ }
+ }, {
+ "label": "navigation-control-lua",
+ "info": "Call Lua Script to set Navigation",
+ "lua": "Audio_Set_Navigation"
+ }]
+ }
+ ],
+ "events":
+ [
+ {
+ "label": "Vehicle-Speed",
+ "info": "Action when Vehicule speed change",
+ "actions": [
+ {
+ "label": "speed-action-1",
+ "callback": "Blink-when-over-130",
+ "args": {
+ "speed": 130
+ "blink-speed": 1000
+ }
+ }, {
+ "label": "Adjust-Volume",
+ "lua": "Adjust_Volume_To_Speed",
+ }
+ ]
+ },
+ {
+ "label": "Reverse-Engage",
+ "info": "When Reverse Gear is Engage",
+ "actions": [
+ {
+ "label": "Display-Rear-Camera",
+ "callback": "Display-Rear-Camera",
+ }, {
+ "label": "Prevent-Phone-Call",
+ "api" : "phone",
+ "verb" : "status",
+ "args": {
+ "call-accepted": false
+ }
+ }
+ ]
+ },
+ {
+ "label": "Neutral-Engage",
+ "info": "When Reverse Neutral is Engage",
+ "actions": [
+ {
+ "label": "Authorize-Video",
+ "api" : "video",
+ "verb" : "status",
+ "args": {
+ "tv-accepted": true
+ }
+ }
+ ]
+ }
+ ]
+}
+
+```
+
diff --git a/Controler-afb/ctl-apidef.h b/Controler-afb/ctl-apidef.h
index 1bd80f9..83b3308 100644
--- a/Controler-afb/ctl-apidef.h
+++ b/Controler-afb/ctl-apidef.h
@@ -37,35 +37,26 @@ static const char _afb_description_v2_control[] =
"name\":\"delay\",\"required\":false,\"schema\":{\"type\":\"interger\"}},"
"{\"in\":\"query\",\"name\":\"count\",\"required\":false,\"schema\":{\"ty"
"pe\":\"interger\"}}],\"responses\":{\"200\":{\"$ref\":\"#/components/res"
- "ponses/200\"}}}},\"/navigation\":{\"description\":\"Request Access to Na"
- "vigation Audio Channel.\",\"get\":{\"x-permissions\":{\"$ref\":\"#/compo"
- "nents/x-permissions/navigation\"},\"parameters\":[{\"in\":\"query\",\"na"
- "me\":\"zone\",\"required\":false,\"schema\":{\"type\":\"string\"}}],\"re"
- "sponses\":{\"200\":{\"$ref\":\"#/components/responses/200\"}}}},\"/multi"
- "media\":{\"description\":\"Request Access to Navigation Audio Channel.\""
- ",\"get\":{\"x-permissions\":{\"$ref\":\"#/components/x-permissions/navig"
- "ation\"},\"parameters\":[{\"in\":\"query\",\"name\":\"zone\",\"required\""
- ":false,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"$ref"
- "\":\"#/components/responses/200\"}}}},\"/emergency\":{\"description\":\""
- "Request Access to Navigation Audio Channel.\",\"get\":{\"x-permissions\""
- ":{\"$ref\":\"#/components/x-permissions/navigation\"},\"parameters\":[{\""
- "in\":\"query\",\"name\":\"zone\",\"required\":false,\"schema\":{\"type\""
- ":\"string\"}}],\"responses\":{\"200\":{\"$ref\":\"#/components/responses"
- "/200\"}}}},\"/lua_docall\":{\"description\":\"Execute LUA string script."
- "\",\"get\":{\"x-permissions\":{\"$ref\":\"#/components/x-permissions/nav"
- "igation\"},\"parameters\":[{\"in\":\"query\",\"name\":\"func\",\"require"
- "d\":true,\"schema\":{\"type\":\"string\"}},{\"in\":\"query\",\"name\":\""
- "args\",\"required\":false,\"schema\":{\"type\":\"array\"}}],\"responses\""
- ":{\"200\":{\"$ref\":\"#/components/responses/200\"}}}},\"/lua_dostring\""
- ":{\"description\":\"Execute LUA string script.\",\"get\":{\"x-permission"
- "s\":{\"$ref\":\"#/components/x-permissions/navigation\"},\"parameters\":"
- "[{\"in\":\"query\",\"required\":true,\"schema\":{\"type\":\"string\"}}],"
- "\"responses\":{\"200\":{\"$ref\":\"#/components/responses/200\"}}}},\"/l"
- "ua_doscript\":{\"description\":\"Execute LUA string script.\",\"get\":{\""
- "x-permissions\":{\"$ref\":\"#/components/x-permissions/navigation\"},\"p"
- "arameters\":[{\"in\":\"query\",\"name\":\"filename\",\"required\":true,\""
- "schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"$ref\":\"#/co"
- "mponents/responses/200\"}}}}}}"
+ "ponses/200\"}}}},\"/select\":{\"description\":\"Request Access to Naviga"
+ "tion Audio Channel.\",\"get\":{\"x-permissions\":{\"$ref\":\"#/component"
+ "s/x-permissions/navigation\"},\"parameters\":[{\"in\":\"query\",\"name\""
+ ":\"zone\",\"required\":false,\"schema\":{\"type\":\"string\"}}],\"respon"
+ "ses\":{\"200\":{\"$ref\":\"#/components/responses/200\"}}}},\"/lua_docal"
+ "l\":{\"description\":\"Execute LUA string script.\",\"get\":{\"x-permiss"
+ "ions\":{\"$ref\":\"#/components/x-permissions/navigation\"},\"parameters"
+ "\":[{\"in\":\"query\",\"name\":\"func\",\"required\":true,\"schema\":{\""
+ "type\":\"string\"}},{\"in\":\"query\",\"name\":\"args\",\"required\":fal"
+ "se,\"schema\":{\"type\":\"array\"}}],\"responses\":{\"200\":{\"$ref\":\""
+ "#/components/responses/200\"}}}},\"/lua_dostring\":{\"description\":\"Ex"
+ "ecute LUA string script.\",\"get\":{\"x-permissions\":{\"$ref\":\"#/comp"
+ "onents/x-permissions/navigation\"},\"parameters\":[{\"in\":\"query\",\"r"
+ "equired\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\""
+ ":{\"$ref\":\"#/components/responses/200\"}}}},\"/lua_doscript\":{\"descr"
+ "iption\":\"Execute LUA string script.\",\"get\":{\"x-permissions\":{\"$r"
+ "ef\":\"#/components/x-permissions/navigation\"},\"parameters\":[{\"in\":"
+ "\"query\",\"name\":\"filename\",\"required\":true,\"schema\":{\"type\":\""
+ "string\"}}],\"responses\":{\"200\":{\"$ref\":\"#/components/responses/20"
+ "0\"}}}}}}"
;
static const struct afb_auth _afb_auths_v2_control[] = {
@@ -74,9 +65,7 @@ static const struct afb_auth _afb_auths_v2_control[] = {
void ctlapi_monitor(struct afb_req req);
void ctlapi_event_test(struct afb_req req);
- void ctlapi_navigation(struct afb_req req);
- void ctlapi_multimedia(struct afb_req req);
- void ctlapi_emergency(struct afb_req req);
+ void ctlapi_select(struct afb_req req);
void ctlapi_lua_docall(struct afb_req req);
void ctlapi_lua_dostring(struct afb_req req);
void ctlapi_lua_doscript(struct afb_req req);
@@ -97,22 +86,8 @@ static const struct afb_verb_v2 _afb_verbs_v2_control[] = {
.session = AFB_SESSION_NONE_V2
},
{
- .verb = "navigation",
- .callback = ctlapi_navigation,
- .auth = &_afb_auths_v2_control[0],
- .info = NULL,
- .session = AFB_SESSION_NONE_V2
- },
- {
- .verb = "multimedia",
- .callback = ctlapi_multimedia,
- .auth = &_afb_auths_v2_control[0],
- .info = NULL,
- .session = AFB_SESSION_NONE_V2
- },
- {
- .verb = "emergency",
- .callback = ctlapi_emergency,
+ .verb = "select",
+ .callback = ctlapi_select,
.auth = &_afb_auths_v2_control[0],
.info = NULL,
.session = AFB_SESSION_NONE_V2
diff --git a/Controler-afb/ctl-apidef.json b/Controler-afb/ctl-apidef.json
index 28b8581..818dd80 100644
--- a/Controler-afb/ctl-apidef.json
+++ b/Controler-afb/ctl-apidef.json
@@ -178,53 +178,7 @@
}
}
},
- "/navigation": {
- "description": "Request Access to Navigation Audio Channel.",
- "get": {
- "x-permissions": {
- "$ref": "#/components/x-permissions/navigation"
- },
- "parameters": [
- {
- "in": "query",
- "name": "zone",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "$ref": "#/components/responses/200"
- }
- }
- }
- },
- "/multimedia": {
- "description": "Request Access to Navigation Audio Channel.",
- "get": {
- "x-permissions": {
- "$ref": "#/components/x-permissions/navigation"
- },
- "parameters": [
- {
- "in": "query",
- "name": "zone",
- "required": false,
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "$ref": "#/components/responses/200"
- }
- }
- }
- },
- "/emergency": {
+ "/select": {
"description": "Request Access to Navigation Audio Channel.",
"get": {
"x-permissions": {
diff --git a/Controler-afb/ctl-binding.h b/Controler-afb/ctl-binding.h
index 70ad0c3..a2cedbf 100644
--- a/Controler-afb/ctl-binding.h
+++ b/Controler-afb/ctl-binding.h
@@ -22,6 +22,8 @@
#define AFB_BINDING_VERSION 2
#include <afb/afb-binding.h>
#include <json-c/json.h>
+#include <filescan-utils.h>
+#include <wrap-json.h>
#ifndef PUBLIC
#define PUBLIC
@@ -41,16 +43,6 @@ typedef struct {
#define CTL_PLUGIN_REGISTER(pluglabel) CtlPluginMagicT CtlPluginMagic={.magic=CTL_PLUGIN_MAGIC,.label=pluglabel}; struct afb_binding_data_v2;
-// ctl-misc.c
-typedef enum {
- CTL_SCAN_FLAT=0,
- CTL_SCAN_RECURSIVE=1,
-} CtlScanDirModeT;
-
-PUBLIC const char *GetMidleName(const char*name);
-PUBLIC const char *GetBinderName();
-PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext);
-
// polctl-binding.c
PUBLIC int CtlBindingInit ();
diff --git a/Controler-afb/ctl-dispatch.c b/Controler-afb/ctl-dispatch.c
index 3318c8d..0594952 100644
--- a/Controler-afb/ctl-dispatch.c
+++ b/Controler-afb/ctl-dispatch.c
@@ -23,7 +23,6 @@
#include <string.h>
#include <dlfcn.h>
-#include "wrap-json.h"
#include "ctl-binding.h"
typedef void*(*DispatchPluginInstallCbT)(const char* label, const char*version, const char*info);
diff --git a/Controler-afb/ctl-events.c b/Controler-afb/ctl-events.c
index f76feca..18aac53 100644
--- a/Controler-afb/ctl-events.c
+++ b/Controler-afb/ctl-events.c
@@ -75,7 +75,7 @@ STATIC int DoSendEvent (void *context) {
else ctx->value =1;
ctlEventJ = json_object_new_object();
- json_object_object_add(ctlEventJ,"action", json_object_new_string(ctx->label));
+ json_object_object_add(ctlEventJ,"signal", json_object_new_string(ctx->label));
json_object_object_add(ctlEventJ,"value" , json_object_new_int(ctx->value));
int done = afb_event_push(afbevt, ctlEventJ);
diff --git a/Controler-afb/ctl-lua.c b/Controler-afb/ctl-lua.c
index 919230d..bf02a31 100644
--- a/Controler-afb/ctl-lua.c
+++ b/Controler-afb/ctl-lua.c
@@ -33,6 +33,7 @@
#define LUA_FIST_ARG 2 // when using luaL_newlib calllback receive libtable as 1st arg
#define LUA_MSG_MAX_LENGTH 255
+#define JSON_ERROR (json_object*)-1
static lua_State* luaState;
@@ -107,7 +108,7 @@ STATIC void LuaCtxFree (LuaAfbContextT *afbContext) {
// Push a json structure on the stack as a LUA table
STATIC int LuaPushArgument (json_object *argsJ) {
- AFB_NOTICE("LuaPushArgument argsJ=%s", json_object_get_string(argsJ));
+ //AFB_NOTICE("LuaPushArgument argsJ=%s", json_object_get_string(argsJ));
json_type jtype= json_object_get_type(argsJ);
switch (jtype) {
@@ -156,6 +157,7 @@ STATIC int LuaPushArgument (json_object *argsJ) {
}
STATIC json_object *PopOneArg (lua_State* luaState, int idx);
+
STATIC json_object *LuaTableToJson (lua_State* luaState, int index) {
int idx;
@@ -171,8 +173,8 @@ STATIC json_object *LuaTableToJson (lua_State* luaState, int index) {
snprintf(number, sizeof(number),"%d", idx);
key=number;
}
-
- json_object_object_add(tableJ, key, PopOneArg(luaState, -1));
+ json_object *argJ= PopOneArg(luaState, -1);
+ json_object_object_add(tableJ, key, argJ);
lua_pop(luaState, 1); // removes 'value'; keeps 'key' for next iteration
}
@@ -189,9 +191,16 @@ STATIC json_object *PopOneArg (lua_State* luaState, int idx) {
int luaType = lua_type(luaState, idx);
switch(luaType) {
- case LUA_TNUMBER:
- value= json_object_new_double(lua_tonumber(luaState, idx));
+ case LUA_TNUMBER: {
+ lua_Number number= lua_tonumber(luaState, idx);;
+ int nombre = (int)number; // evil trick to determine wether n fits in an integer. (stolen from ltcl.c)
+ if (number == nombre) {
+ value= json_object_new_int((int)number);
+ } else {
+ value= json_object_new_double(number);
+ }
break;
+ }
case LUA_TBOOLEAN:
value= json_object_new_boolean(lua_toboolean(luaState, idx));
break;
@@ -199,15 +208,23 @@ STATIC json_object *PopOneArg (lua_State* luaState, int idx) {
value= json_object_new_string(lua_tostring(luaState, idx));
break;
case LUA_TTABLE: {
- value= LuaTableToJson(luaState, idx);
+ if (idx > 0) {
+ value= LuaTableToJson(luaState, idx);
+ } else {
+ value= json_object_new_string("UNSUPPORTED_Lua_Nested_Table");
+ }
break;
}
+ case LUA_TNIL:
+ value=json_object_new_string("nil") ;
+ break;
+
default:
AFB_NOTICE ("PopOneArg: script returned Unknown/Unsupported idx=%d type:%d/%s", idx, luaType, lua_typename(luaState, luaType));
value=NULL;
}
- return value;
+ return value;
}
static json_object *LuaPopArgs (lua_State* luaState, int start) {
@@ -223,24 +240,28 @@ static json_object *LuaPopArgs (lua_State* luaState, int start) {
// loop on remaining return arguments
responseJ= json_object_new_array();
for (int idx=start; idx <= stop; idx++) {
- json_object_array_add(responseJ, PopOneArg (luaState, idx));
+ json_object *argJ=PopOneArg (luaState, idx);
+ if (!argJ) goto OnErrorExit;
+ json_object_array_add(responseJ, argJ);
}
}
return responseJ;
-}
+
+ OnErrorExit:
+ return NULL;
+}
-STATIC void LuaFormatMessage(lua_State* luaState, LuaAfbMessageT action) {
+
+STATIC int LuaFormatMessage(lua_State* luaState, LuaAfbMessageT action) {
char *message;
json_object *responseJ= LuaPopArgs(luaState, LUA_FIST_ARG);
+
if (!responseJ) {
- message="-- Empty Message ???";
- goto PrintMessage;
+ luaL_error(luaState,"LuaFormatMessage empty message");
+ goto OnErrorExit;
}
-
- //AFB_NOTICE("**** responseJ=%s", json_object_get_string(responseJ));
-
// if we have only on argument just return the value.
if (json_object_get_type(responseJ)!=json_type_array || json_object_array_length(responseJ) <2) {
@@ -290,6 +311,7 @@ STATIC void LuaFormatMessage(lua_State* luaState, LuaAfbMessageT action) {
message[targetIdx++] = format[idx];
}
}
+ message[targetIdx]='\0';
PrintMessage:
switch (action) {
@@ -309,31 +331,35 @@ PrintMessage:
default:
AFB_ERROR (message);
}
+ return 0; // nothing return to lua
+
+ OnErrorExit: // on argument to return (the error message)
+ return 1;
}
STATIC int LuaPrintInfo(lua_State* luaState) {
- LuaFormatMessage (luaState, AFB_MSG_INFO);
- return 0; // no value return
+ int err=LuaFormatMessage (luaState, AFB_MSG_INFO);
+ return err;
}
STATIC int LuaPrintError(lua_State* luaState) {
- LuaFormatMessage (luaState, AFB_MSG_ERROR);
- return 0; // no value return
+ int err=LuaFormatMessage (luaState, AFB_MSG_ERROR);
+ return err; // no value return
}
STATIC int LuaPrintWarning(lua_State* luaState) {
- LuaFormatMessage (luaState, AFB_MSG_WARNING);
- return 0; // no value return
+ int err=LuaFormatMessage (luaState, AFB_MSG_WARNING);
+ return err;
}
STATIC int LuaPrintNotice(lua_State* luaState) {
- LuaFormatMessage (luaState, AFB_MSG_NOTICE);
- return 0; // no value return
+ int err=LuaFormatMessage (luaState, AFB_MSG_NOTICE);
+ return err;
}
STATIC int LuaPrintDebug(lua_State* luaState) {
- LuaFormatMessage (luaState, AFB_MSG_DEBUG);
- return 0; // no value return
+ int err=LuaFormatMessage (luaState, AFB_MSG_DEBUG);
+ return err;
}
STATIC int LuaAfbSuccess(lua_State* luaState) {
@@ -342,6 +368,7 @@ STATIC int LuaAfbSuccess(lua_State* luaState) {
// ignore context argument
json_object *responseJ= LuaPopArgs(luaState, LUA_FIST_ARG+1);
+ if (responseJ == JSON_ERROR) return 1;
afb_req_success(afbContext->request, responseJ, NULL);
@@ -358,6 +385,7 @@ STATIC int LuaAfbFail(lua_State* luaState) {
if (!afbContext) goto OnErrorExit;
json_object *responseJ= LuaPopArgs(luaState, LUA_FIST_ARG+1);
+ if (responseJ == JSON_ERROR) return 1;
afb_req_fail(afbContext->request, afbContext->info, json_object_get_string(responseJ));
@@ -400,6 +428,7 @@ STATIC int LuaAfbService(lua_State* luaState) {
const char *api = lua_tostring(luaState,2);
const char *verb= lua_tostring(luaState,3);
json_object *queryJ= LuaTableToJson(luaState, 4);
+ if (queryJ == JSON_ERROR) return 1;
LuaCallServiceT *contextCB = calloc (1, sizeof(LuaCallServiceT));
contextCB->callback= lua_tostring(luaState, 5);
@@ -597,7 +626,6 @@ STATIC void LuaDoAction (LuaDoActionT action, afb_req request) {
lua_pushnil(luaState);
count++;
} else {
- AFB_NOTICE("***** args=%s", json_object_get_string(argsJ));
count+= LuaPushArgument (argsJ);
}
@@ -606,15 +634,17 @@ STATIC void LuaDoAction (LuaDoActionT action, afb_req request) {
case LUA_DOSCRIPT: { // Fulup need to fix argument passing
const char *script;
+ char*func;
+ char *filename; char*fullpath;
char luaScriptPath[CONTROL_MAXPATH_LEN];
- json_object *args;
+ json_object *argsJ;
int index;
// scan luascript search path once
static json_object *luaScriptPathJ =NULL;
if (!luaScriptPathJ) luaScriptPathJ= ScanForConfig(CONTROL_LUA_PATH , CTL_SCAN_RECURSIVE, CONTROL_DOSCRIPT_PRE, "lua");
- err= wrap_json_unpack (queryJ, "{s:s, s?o s?o !}", "script", &script,"args", &args, "arg", &args);
+ err= wrap_json_unpack (queryJ, "{s:s, s?s s?o s?o !}", "script", &script,"func", &func, "arg", &argsJ);
if (err) {
AFB_ERROR ("LUA-DOSCRIPT-SYNTAX:missing script|(args,arg) query=%s", json_object_get_string(queryJ));
goto OnErrorExit;
@@ -623,7 +653,6 @@ STATIC void LuaDoAction (LuaDoActionT action, afb_req request) {
// search for filename=script in CONTROL_LUA_PATH
for (index=0; index < json_object_array_length(luaScriptPathJ); index++) {
json_object *entryJ=json_object_array_get_idx(luaScriptPathJ, index);
- char *filename; char*fullpath;
err= wrap_json_unpack (entryJ, "{s:s, s:s !}", "fullpath", &fullpath,"filename", &filename);
if (err) {
@@ -649,15 +678,27 @@ STATIC void LuaDoAction (LuaDoActionT action, afb_req request) {
goto OnErrorExit;
}
- // push query on the stack
- if (json_object_get_type(args) != json_type_array) {
- count= LuaPushArgument (args);
- } else {
- for (int idx=0; idx<json_object_array_length(args); idx++) {
- count += LuaPushArgument (json_object_array_get_idx(args, idx));
- if (err) break;
- }
- }
+ // if no func name given try to deduct from filename
+ if (!func) func= (char*)GetMidleName(filename);
+ if (!func) {
+ AFB_ERROR ("LUA-DOSCRIPT:FAIL to deduct funcname from %s", filename);
+ goto OnErrorExit;
+ }
+
+ // load function (should exist in CONTROL_PATH_LUA
+ lua_getglobal(luaState, func);
+
+ // Push AFB client context on the stack
+ LuaAfbContextT *afbContext= LuaCtxPush(luaState, request, func);
+ if (!afbContext) goto OnErrorExit;
+
+ // push function arguments
+ if (!argsJ) {
+ lua_pushnil(luaState);
+ count++;
+ } else {
+ count+= LuaPushArgument (argsJ);
+ }
break;
}
diff --git a/README.md b/README.md
index 5daae1e..5d03694 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,10 @@ git pull --recurse-submodules https://github.com/iotbzh/audio-bindings
OpenSuse
- LUA-5.3-devel https://software.opensuse.org//download.html?project=devel%3Alanguages%3Alua&package=lua53
- Alsa-devel zypper --install alsa-devel # 42.3 is shipped default with 1.1.4
+
+ Fedora 26 (out of the box)
+ - Lua 5.3
+ - Alsa-devel 1.1.4
```
@@ -137,6 +141,7 @@ Note: remote-target-populate will
- create a script to remotely start the binder on the target in ./build/target/start-on-target-name.sh
- create a gdbinit file to transparently debug remotely in source code with gdb -x ./build/target/gdb-on-target-name.ini
- to run and debug directly from your IDE just configure the run and debug properties with the corresponding filename
+ - run a generic control and pass virtual channel as a parameter (check remaning PCM in plugin)
Note that Netbeans impose to set debug directory to ./build/pkgout or it won't find binding symbols for source debugging
diff --git a/conf.d/project/config.d/onload-audio-control.json b/conf.d/project/config.d/onload-audio-control.json
index c8f9be2..1a45f99 100644
--- a/conf.d/project/config.d/onload-audio-control.json
+++ b/conf.d/project/config.d/onload-audio-control.json
@@ -36,13 +36,27 @@
[
{
"label": "multimedia",
- "actions": [{
+ "actions": {
"label": "multimedia-control-lua",
"info": "Call Lua Script function Test_Lua_Engin",
- "lua": "Audio_Set_Multimedia",
- }]
+ "lua": "Audio_Set_Multimedia"
+ }
}, {
"label": "navigation",
+ "actions": {
+ "label": "navigation-control-lua",
+ "info": "Call Lua Script to set Navigation",
+ "lua": "Audio_Set_Navigation"
+ }
+ }, {
+ "label": "emergency",
+ "actions": {
+ "label": "emergency-control-ucm",
+ "lua": "Audio_Set_Emergency"
+ }
+ }, {
+ "label": "multi-step-sample",
+ "info" : "all actions must succeed for control to be accepted",
"actions": [{
"label": "multimedia-control-cb",
"info": "Call Sharelib Sample Callback",
@@ -61,13 +75,7 @@
}, {
"label": "navigation-control-lua",
"info": "Call Lua Script to set Navigation",
- "lua": "Audio_Set_Navigation",
- }]
- }, {
- "label": "emergency",
- "actions": [{
- "label": "emergency-control-ucm",
- "lua": "Audio_Set_Emergency",
+ "lua": "Audio_Set_Navigation"
}]
}
],
diff --git a/conf.d/project/lua.d/onload-audio-controls.lua b/conf.d/project/lua.d/onload-audio-controls.lua
index 2fbf4f5..b6fd811 100644
--- a/conf.d/project/lua.d/onload-audio-controls.lua
+++ b/conf.d/project/lua.d/onload-audio-controls.lua
@@ -22,13 +22,32 @@ function Audio_Init_CB (status, result, context)
print ("--inlua:Audio_Init_CB-- result=", Dump_Table(result))
print ("--inlua:Audio_Init_CB-- context=", Dump_Table(context))
- -- (Fulup Bug) AFB:debug ("Audio_Init_Hal result=%s context=%s", result, context)
- AFB:debug ("Audio_Init_Hal result=%s context=%s", {["ret1"]=5678, ["ret2"]="abcd"}, context)
+
+ -- AFB:notice ("Audio_Init_Hal result='%s' context='%s'", result, context)
+ -- AFB:debug ("Audio_Init_Hal result=%s context=%s", {["ret1"]=5678, ["ret2"]="abcd"}, context)
end
-- Function call at binding load time
function Audio_Init_Hal(args, query)
+
+ local nextT = {
+ ["next1"]=1234,
+ ["next2"]="nested",
+ ["next3"]=9999,
+ }
+
+ local response = {
+ ["arg1"]=1234,
+ ["arg2"]=nextT,
+ ["arg3"]=5678,
+ }
+
+ print ("--inlua:Audio_Init-- response=", Dump_Table(response))
+
+ AFB:notice ("**** in-lua table='%s' ****", response)
+
+
AFB:notice ("--LUA:Audio_Init_Hal args=%s query=%s", args, query);
-- query asynchronously loaded HAL
diff --git a/htdocs/audio-control.html b/htdocs/audio-control.html
index fdd3daa..89addcc 100644
--- a/htdocs/audio-control.html
+++ b/htdocs/audio-control.html
@@ -31,7 +31,7 @@
<br>
<li><button onclick="callbinder('control','lua_dostring','print(\'Bonjours\'); return true, 1234');">LUA string</button></li>
<li><button onclick="callbinder('control','lua_docall' , {'func':'Simple_Echo_Args', 'args':{speed:20}});">LUA function</button></li>
- <li><button onclick="callbinder('control','lua_doscript', {'script':'helloworld-lua-script.lua', args:{'arg1':'abcd', 'next':7890, 'last':[1,2,3,4]});">LUA script</button></li>
+ <li><button onclick="callbinder('control','lua_doscript', {'script':'helloworld-lua-script.lua', args:{'arg1':'abcd', 'next':7890, 'last':[1,2,3,4]}});">LUA script</button></li>
</ol>
diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml
index 8d0b065..8d7491c 100644
--- a/nbproject/configurations.xml
+++ b/nbproject/configurations.xml
@@ -23,6 +23,7 @@
</df>
<df name="Audio-Common">
<in>audio-common.c</in>
+ <in>filescan-utils.c</in>
<in>wrap-json.c</in>
</df>
<df name="build">
@@ -117,8 +118,8 @@
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<flagsDictionary>
- <element flagsID="0" commonFlags="-g -fPIC -fPIC -g"/>
- <element flagsID="1" commonFlags="-g -fPIC -fPIC -g -ggdb"/>
+ <element flagsID="0" commonFlags="-g -fPIC -fPIC"/>
+ <element flagsID="1" commonFlags="-g -fPIC -fPIC -g"/>
<element flagsID="2" commonFlags="-mtune=generic -march=x86-64 -g -fPIC"/>
<element flagsID="3" commonFlags="-mtune=generic -march=x86-64 -g -g -fPIC"/>
<element flagsID="4"
@@ -133,28 +134,7 @@
<buildCommand>${MAKE} -f Makefile install</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
<executablePath>build/CMakeFiles/feature_tests.bin</executablePath>
- <cTool flags="-g -fPIC -fPIC">
- <incDir>
- <pElem>../../../opt/include</pElem>
- <pElem>../../../opt/include/alsa</pElem>
- <pElem>/usr/include/p11-kit-1</pElem>
- <pElem>/usr/include/json-c</pElem>
- <pElem>/usr/include/lua5.3</pElem>
- </incDir>
- <preprocessorList>
- <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
- <Elem>CONTROL_CONFIG_POST="control"</Elem>
- <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
- <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
- <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
- <Elem>CONTROL_MAXPATH_LEN=255</Elem>
- <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
- <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
- <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
- <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
- <Elem>MAX_SND_CARD=16</Elem>
- <Elem>TLV_BYTE_SIZE=256</Elem>
- </preprocessorList>
+ <cTool flags="0">
</cTool>
</makeTool>
<preBuild>
@@ -167,102 +147,201 @@
ex="false"
tool="0"
flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="Alsa-afb/Alsa-AddCtl.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="Alsa-afb/Alsa-ApiHat.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="Alsa-afb/Alsa-RegEvt.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="Alsa-afb/Alsa-SetGet.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="Alsa-afb/Alsa-Ucm.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="Audio-Common/audio-common.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
- <item path="Audio-Common/wrap-json.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <item path="Audio-Common/filescan-utils.c" ex="false" tool="0" flavor2="2">
+ <cTool flags="0">
</cTool>
</item>
- <item path="Common/AudioCommonLib.c" ex="false" tool="0" flavor2="2">
+ <item path="Audio-Common/wrap-json.c" ex="false" tool="0" flavor2="3">
<cTool flags="0">
</cTool>
</item>
- <item path="Controler-afb/ctl-binding.c" ex="false" tool="0" flavor2="0">
+ <item path="Common/AudioCommonLib.c" ex="false" tool="0" flavor2="2">
<cTool flags="1">
+ </cTool>
+ </item>
+ <item path="Controler-afb/ctl-binding.c" ex="false" tool="0" flavor2="3">
+ <cTool flags="0">
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
</cTool>
</item>
- <item path="Controler-afb/ctl-dispatch.c" ex="false" tool="0" flavor2="2">
- <cTool flags="1">
+ <item path="Controler-afb/ctl-dispatch.c" ex="false" tool="0" flavor2="3">
+ <cTool flags="0">
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
</cTool>
</item>
- <item path="Controler-afb/ctl-events.c" ex="false" tool="0" flavor2="2">
- <cTool flags="1">
+ <item path="Controler-afb/ctl-events.c" ex="false" tool="0" flavor2="3">
+ <cTool flags="0">
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
</cTool>
</item>
- <item path="Controler-afb/ctl-lua.c" ex="false" tool="0" flavor2="2">
- <cTool flags="1">
+ <item path="Controler-afb/ctl-lua.c" ex="false" tool="0" flavor2="3">
+ <cTool flags="0">
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
</cTool>
</item>
- <item path="Controler-afb/ctl-misc.c" ex="false" tool="0" flavor2="2">
- <cTool flags="1">
+ <item path="Controler-afb/ctl-misc.c" ex="false" tool="0" flavor2="3">
+ <cTool flags="2">
<incDir>
- <pElem>Audio-Common</pElem>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>Controler-afb</pElem>
+ <pElem>/usr/include/json-c</pElem>
<pElem>build/Controler-afb</pElem>
</incDir>
- <preprocessorList>
- <Elem>control_afb_EXPORTS</Elem>
- </preprocessorList>
</cTool>
</item>
- <item path="Controler-afb/ctl-plugin-sample.c" ex="false" tool="0" flavor2="2">
- <cTool flags="1">
+ <item path="Controler-afb/ctl-plugin-sample.c" ex="false" tool="0" flavor2="3">
+ <cTool flags="0">
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>audio_plugin_sample_EXPORTS</Elem>
</preprocessorList>
</cTool>
@@ -271,18 +350,18 @@
ex="false"
tool="0"
flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="HAL-afb/HAL-interface/hal-volramp.c"
ex="false"
tool="0"
flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="HAL-afb/HAL-interface/hal-volume.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="HAL-afb/HAL-plugin/HalPlugPcm.c" ex="false" tool="0" flavor2="3">
@@ -290,21 +369,21 @@
</cTool>
</item>
<item path="HAL-afb/HDA-intel/IntelHdaHAL.c" ex="false" tool="0" flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="HAL-afb/Jabra-Solemate/JabraUsbHAL.c"
ex="false"
tool="0"
flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="HAL-afb/Scarlett-Focusrite/ScarlettUsbHAL.c"
ex="false"
tool="0"
flavor2="3">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="HAL-afb/Unicens-USB/UnicensHAL.c" ex="false" tool="0" flavor2="3">
@@ -369,12 +448,29 @@
<folder path="0/Alsa-Plugin">
<cTool>
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>build/Alsa-Plugin/Alsa-Policy-Hook</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
<Elem>NATIVE_LINUX</Elem>
<Elem>PIC</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>policy_hook_cb_EXPORTS</Elem>
</preprocessorList>
</cTool>
@@ -382,12 +478,29 @@
<folder path="0/Alsa-afb">
<cTool>
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Alsa-afb</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
<Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>alsa_lowlevel_EXPORTS</Elem>
</preprocessorList>
</cTool>
@@ -395,18 +508,40 @@
<folder path="0/Audio-Common">
<cTool>
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Audio-Common</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
<Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
</preprocessorList>
</cTool>
</folder>
<folder path="0/Common">
<cTool>
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
<pElem>build/HAL-afb/HAL-plugin</pElem>
@@ -416,17 +551,45 @@
<preprocessorList>
<Elem>CONTROL_CDEV_RX="/dev/inic-usb-crx"</Elem>
<Elem>CONTROL_CDEV_TX="/dev/inic-usb-ctx"</Elem>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
<Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>audio_plugin_sample_EXPORTS</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
</cTool>
</folder>
- <folder path="0/Controler-afb">
+ <folder path="0/HAL-afb">
<cTool>
+ <incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ </incDir>
<preprocessorList>
- <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
- <Elem>NATIVE_LINUX</Elem>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
</preprocessorList>
</cTool>
</folder>
@@ -455,7 +618,6 @@
<preprocessorList>
<Elem>CONTROL_CDEV_RX="/dev/inic-usb-crx"</Elem>
<Elem>CONTROL_CDEV_TX="/dev/inic-usb-ctx"</Elem>
- <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
<Elem>audio_plugin_sample_EXPORTS</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
@@ -515,7 +677,6 @@
<preprocessorList>
<Elem>CONTROL_CDEV_RX="/dev/inic-usb-crx"</Elem>
<Elem>CONTROL_CDEV_TX="/dev/inic-usb-ctx"</Elem>
- <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
<Elem>audio_plugin_sample_EXPORTS</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
@@ -524,6 +685,11 @@
<folder path="0/HighLevel-afb">
<cTool>
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
<pElem>build/HAL-afb/HAL-plugin</pElem>
@@ -533,7 +699,18 @@
<pElem>build/HighLevel-afb</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
<Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>audio_plugin_sample_EXPORTS</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
@@ -542,12 +719,28 @@
<folder path="0/MostVolume">
<cTool>
<incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
<pElem>build/HAL-afb/HAL-plugin</pElem>
</incDir>
<preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
<Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
<Elem>audio_plugin_sample_EXPORTS</Elem>
<Elem>control_afb_EXPORTS</Elem>
</preprocessorList>
@@ -922,7 +1115,7 @@
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<flagsDictionary>
- <element flagsID="0" commonFlags="-g -ggdb -fPIC -fPIC -g -ggdb"/>
+ <element flagsID="0" commonFlags="-g -fPIC -fPIC"/>
<element flagsID="1"
commonFlags="-mtune=generic -march=x86-64 -g -ggdb -g -ggdb -fPIC"/>
</flagsDictionary>
@@ -934,7 +1127,7 @@
<buildCommand>${MAKE} </buildCommand>
<cleanCommand>${MAKE} clean</cleanCommand>
<executablePath></executablePath>
- <cTool flags="0">
+ <cTool flags="-g -ggdb -fPIC -fPIC -g -ggdb">
</cTool>
</makeTool>
<preBuild>
@@ -1022,6 +1215,18 @@
</item>
<item path="Common/AudioCommonLib.c" ex="false" tool="0" flavor2="2">
</item>
+ <item path="Controler-afb/ctl-binding.c" ex="false" tool="0" flavor2="0">
+ <cTool flags="0">
+ </cTool>
+ </item>
+ <item path="Controler-afb/ctl-events.c" ex="false" tool="0" flavor2="0">
+ <cTool flags="0">
+ </cTool>
+ </item>
+ <item path="Controler-afb/ctl-lua.c" ex="false" tool="0" flavor2="0">
+ <cTool flags="0">
+ </cTool>
+ </item>
<item path="HAL-afb/HAL-interface/hal-interface.c"
ex="false"
tool="0"
@@ -1149,11 +1354,20 @@
<pElem>../../../opt/include/alsa</pElem>
<pElem>/usr/include/p11-kit-1</pElem>
<pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
<pElem>build/Alsa-Plugin/Alsa-Policy-Hook</pElem>
</incDir>
<preprocessorList>
- <Elem>CONTROL_CDEV_RX="/dev/inic-usb-crx"</Elem>
- <Elem>CONTROL_CDEV_TX="/dev/inic-usb-ctx"</Elem>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
<Elem>MAX_LINEAR_DB_SCALE=24</Elem>
<Elem>MAX_SND_CARD=16</Elem>
<Elem>NATIVE_LINUX</Elem>
@@ -1181,6 +1395,36 @@
</incDir>
</cTool>
</folder>
+ <folder path="0/Controler-afb">
+ <cTool>
+ <incDir>
+ <pElem>../../../opt/include</pElem>
+ <pElem>../../../opt/include/alsa</pElem>
+ <pElem>/usr/include/p11-kit-1</pElem>
+ <pElem>/usr/include/json-c</pElem>
+ <pElem>/usr/include/lua5.3</pElem>
+ <pElem>Audio-Common</pElem>
+ <pElem>build/Controler-afb</pElem>
+ </incDir>
+ <preprocessorList>
+ <Elem>CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d"</Elem>
+ <Elem>CONTROL_CONFIG_POST="control"</Elem>
+ <Elem>CONTROL_CONFIG_PRE="onload"</Elem>
+ <Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>CONTROL_LUA_EVENT="luaevt"</Elem>
+ <Elem>CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d"</Elem>
+ <Elem>CONTROL_MAXPATH_LEN=255</Elem>
+ <Elem>CONTROL_ONLOAD_DEFAULT="onload-default"</Elem>
+ <Elem>CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug"</Elem>
+ <Elem>CTL_PLUGIN_MAGIC=2468013579</Elem>
+ <Elem>MAX_LINEAR_DB_SCALE=24</Elem>
+ <Elem>MAX_SND_CARD=16</Elem>
+ <Elem>NATIVE_LINUX</Elem>
+ <Elem>TLV_BYTE_SIZE=256</Elem>
+ <Elem>control_afb_EXPORTS</Elem>
+ </preprocessorList>
+ </cTool>
+ </folder>
<folder path="0/HAL-afb/HAL-interface">
<cTool>
<incDir>
diff --git a/nbproject/project.xml b/nbproject/project.xml
index 5f13ad6..7c62c94 100644
--- a/nbproject/project.xml
+++ b/nbproject/project.xml
@@ -34,5 +34,8 @@
<project-formatting-style>false</project-formatting-style>
</formatting>
</data>
+ <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
+ <word>Controler</word>
+ </spellchecker-wordlist>
</configuration>
</project>