summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-08-15 14:13:49 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-08-15 14:13:49 +0200
commit716d28f99637d6f2b8eb2758c2da41da67b8027c (patch)
tree4cdfedf7128641b5a4a30f348140aff1c9b8a385
parente8b7ffa70194d1cc3ef4cc52bb0ace9f133514cf (diff)
Documentation
-rw-r--r--Controler-afb/ctl-lua.c3
-rw-r--r--Controler-afb/ctl-policy.c221
-rw-r--r--README.md147
-rw-r--r--data/CMakeLists.txt46
-rw-r--r--data/default-control-policy.json90
-rw-r--r--nbproject/configurations.xml63
6 files changed, 495 insertions, 75 deletions
diff --git a/Controler-afb/ctl-lua.c b/Controler-afb/ctl-lua.c
index a7cd52f..919230d 100644
--- a/Controler-afb/ctl-lua.c
+++ b/Controler-afb/ctl-lua.c
@@ -275,7 +275,8 @@ STATIC void LuaFormatMessage(lua_State* luaState, LuaAfbMessageT action) {
break;
case'%':
- targetIdx += snprintf (&message[targetIdx], LUA_MSG_MAX_LENGTH-targetIdx,"%");
+ message[targetIdx]='%';
+ targetIdx++;
break;
case 's':
diff --git a/Controler-afb/ctl-policy.c b/Controler-afb/ctl-policy.c
new file mode 100644
index 0000000..e9798b3
--- /dev/null
+++ b/Controler-afb/ctl-policy.c
@@ -0,0 +1,221 @@
+/*
+ * 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, something express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <dirent.h>
+#include <json-c/json_object.h>
+
+#include "wrap-json.h"
+#include "ctl-binding.h"
+
+STATIC PolicyCtlConfigT *ctlHandle = NULL;
+
+// List Avaliable Configuration Files
+STATIC json_object* ScanForConfig (char* searchPath) {
+ json_object *responseJ;
+ DIR *dirHandle;
+ char *dirPath;
+ char* dirList= strdup(searchPath);
+
+ responseJ = json_object_new_array();
+ for (dirPath= strtok(dirList, ":"); dirPath && *dirPath; dirPath=strtok(NULL,":")) {
+ struct dirent *dirEnt;
+
+ dirHandle = opendir (dirPath);
+ if (!dirHandle) {
+ AFB_NOTICE ("CONFIG-SCANNING dir=%s not readable", dirPath);
+ continue;
+ }
+
+ AFB_NOTICE ("CONFIG-SCANNING:ctl_listconfig scanning: %s", dirPath);
+ while ((dirEnt = readdir(dirHandle)) != NULL) {
+ // Unknown type is accepted to support dump filesystems
+ if (dirEnt->d_type == DT_REG || dirEnt->d_type == DT_UNKNOWN) {
+ struct json_object *pathJ = json_object_new_object();
+ json_object_object_add(pathJ, "dirpath", json_object_new_string(dirPath));
+ json_object_object_add(pathJ, "filename", json_object_new_string(dirEnt->d_name));
+ json_object_array_add(responseJ, pathJ);
+ }
+ }
+ }
+
+ free (dirList);
+ return (responseJ);
+}
+
+PUBLIC void ctlapi_authorize (PolicyCtlEnumT control, afb_req request) {
+ json_object*tmpJ;
+
+ json_object* queryJ= afb_req_json(request);
+ int done=json_object_object_get_ex(queryJ, "closing", &tmpJ);
+ if (done) return;
+
+}
+
+
+// List Avaliable Configuration Files
+PUBLIC void ctlapi_config (struct afb_req request) {
+ json_object*tmpJ;
+ char *dirList;
+
+ json_object* queryJ = afb_req_json(request);
+ if (queryJ && json_object_object_get_ex (queryJ, "cfgpath" , &tmpJ)) {
+ dirList = strdup (json_object_get_string(tmpJ));
+ } else {
+ dirList = strdup (CONTROL_CONFIG_PATH);
+ AFB_NOTICE ("CONFIG-MISSING: use default CONTROL_CONFIG_PATH=%s", CONTROL_CONFIG_PATH);
+ }
+
+ // get list of config file
+ struct json_object *responseJ = ScanForConfig(dirList);
+
+ if (json_object_array_length(responseJ) == 0) {
+ afb_req_fail(request, "CONFIGPATH:EMPTY", "No Config Found in CONTROL_CONFIG_PATH");
+ } else {
+ afb_req_success(request, responseJ, NULL);
+ }
+
+ return;
+}
+
+STATIC PolicyActionT **PolicyLoadActions (json_object *actionsJ) {
+ int err;
+ PolicyActionT ** actions;
+
+ // unpack individual action object
+ int actionUnpack (json_object *actionJ, PolicyActionT *action) {
+
+ err= wrap_json_unpack(actionJ, "{ss,s?s,s?s,s?s,s?s,s?s !}"
+ , "label",&action->label, "info",&action->info, "callback",&action->callback, "query",&queryJ, "api",&action->api, "verb", &action->verb);
+ if (err) {
+ AFB_ERROR ("POLICY-LOAD-ACTION Missing something label|info|callback|api|verb|query in %s", json_object_get_string(actionJ));
+ return -1;
+ }
+ if (!action->callback || !(action->api && action->verb)) {
+ AFB_ERROR ("POLICY-LOAD-ACTION Missing something callback|(api+verb) in %s", json_object_get_string(actionJ));
+ return -1;
+ }
+ return 0;
+ };
+
+ // action array is close with a nullvalue;
+ if (json_object_get_type(actionsJ) == json_type_array) {
+ int count = json_object_array_length(actionsJ);
+ actions = calloc (count+1, sizeof(PolicyActionT));
+
+ for (int idx=0; idx < count; idx++) {
+ json_object *actionJ = json_object_array_get_idx(actionsJ, idx);
+ err = actionUnpack (actionJ, &actions[idx]);
+ if (err) goto OnErrorExit;
+ }
+
+ } else {
+ actions = calloc (2, sizeof(PolicyActionT));
+ err = actionUnpack (actionsJ, &actions[0]);
+ if (err) goto OnErrorExit;
+ }
+
+ return actions;
+
+ OnErrorExit:
+ return NULL;
+
+}
+
+// load control policy from file using json_unpack https://jansson.readthedocs.io/en/2.9/apiref.html#parsing-and-validating-values
+STATIC PolicyCtlConfigT *PolicyLoadConfig (const char* filepath) {
+ json_object *policyConfigJ, *ignoreJ, *actionsJ;
+ PolicyCtlConfigT *policyConfig = calloc (1, sizeof(PolicyCtlConfigT));
+ int err;
+
+ // Load JSON file
+ policyConfigJ= json_object_from_file(filepath);
+ if (!policyConfigJ) goto OnErrorExit;
+
+ json_object *metadataJ, *onloadJ, *controlsJ, *eventsJ;
+ err= wrap_json_unpack(policyConfigJ, "{s?o,so,s?o,so,so !}", "$schema", &ignoreJ, "metadata",&metadataJ, "onload",&onloadJ, "controls",&controlsJ, "events",&eventsJ);
+ if (err) {
+ AFB_ERROR ("POLICY-LOAD-ERRROR Missing something metadata|onload|controls|events in %s", json_object_get_string(policyConfigJ));
+ goto OnErrorExit;
+ }
+
+ PolicyHandleT *policyHandle = calloc (1, sizeof(PolicyHandleT));
+ err= wrap_json_unpack(metadataJ, "{so,s?s,s?s !}", "label", &policyHandle->label, "info",&policyHandle->info, "version",&policyHandle->version);
+ if (err) {
+ AFB_ERROR ("POLICY-LOAD-CONFIG Missing something label|info|version in %s", json_object_get_string(metadataJ));
+ goto OnErrorExit;
+ }
+
+ if (onloadJ) {
+ err= wrap_json_unpack(onloadJ, "{s?o,s?s,s?s !}", "info",&ignoreJ, "label",&ignoreJ, "actions",&actionsJ);
+ if (err) {
+ AFB_ERROR ("POLICY-LOAD-CONFIG Missing something label|info|plugin|actions in %s", json_object_get_string(metadataJ));
+ goto OnErrorExit;
+ }
+ policyConfig->onload = PolicyLoadActions (actionsJ);
+ }
+
+ return policyControl;
+
+OnErrorExit:
+ return NULL;
+}
+
+// Load default config file at init
+PUBLIC int PolicyInit () {
+ int index, err;
+
+
+ // search for default policy config file
+ json_object* responseJ = ScanForConfig(CONTROL_CONFIG_PATH);
+
+ for (index=0; index < json_object_array_length(responseJ); index++) {
+ json_object *entryJ=json_object_array_get_idx(responseJ, index);
+
+ char *filename; char*dirpath;
+ err= wrap_json_unpack (entryJ, "{s:s, s:s !}", "dirpath", &dirpath,"filename", &filename);
+ if (err) {
+ AFB_ERROR ("POLICY-INIT HOOPs invalid config file path = %s", json_object_get_string(entryJ));
+ goto OnErrorExit;
+ }
+
+ if (strcasestr(filename, CONTROL_CONFIG_FILE)) {
+ char filepath[255];
+ strncpy(filepath, dirpath, sizeof(filepath));
+ strncat(filepath, "/", sizeof(filepath));
+ strncat(filepath, filename, sizeof(filepath));
+ ctlHandle = PolicyLoadConfig (filepath);
+ if (!ctlHandle) goto OnErrorExit;
+ break;
+ }
+ }
+
+ // no policy config found remove control API from binder
+ if (index == 0) goto OnErrorExit;
+
+ AFB_NOTICE ("SUCCES: Audio Control Policy Init");
+ return 0;
+
+OnErrorExit:
+ AFB_NOTICE ("ERROR: Audio Control Policy Init");
+ return 1;
+}
+
+
+
diff --git a/README.md b/README.md
index 4e449cb..5daae1e 100644
--- a/README.md
+++ b/README.md
@@ -1,78 +1,63 @@
------------------------------------------------------------------------
-AGL-AUDIO bindings expose low+high level API through AGL framework
+ AGL-Advanced-Audio-Agent
------------------------------------------------------------------------
-Cloning Audio-Binding from Git
+# Cloning Audio-Binding from Git
-------------------------------------------------------
```
+# Initial clone with submodules
git clone --recurse-submodules https://github.com/iotbzh/audio-bindings
cd audio-binding
+# Do not forget submodules with pulling
+git pull --recurse-submodules https://github.com/iotbzh/audio-bindings
+
```
-AFB_daemon dependency on Standard Linux Distributions
+# AFB-daemon dependencies
-------------------------------------------------------
- # handle dependencies > (OpenSuse-42.2, Fedora-25, Ubuntu 16.04.2LTS)
- gcc > 4.8
- systemd-devel (libsystemd-dev>=222)
- libuuid-devel
- file-devel(OpenSuSe) or libmagic-dev(Ubuntu)
- libjson-c-devel
- alsa-devel
- ElectricFence (BUG should not be mandatory)
- libopenssl-devel libgcrypt-devel libgnutls-devel (optional but requested by libmicrohttpd for https)
- OpenSuse >=42.2
- zypper in gcc5 gdb gcc5-c++ git cmake make ElectricFence systemd-devel libopenssl-devel libuuid-devel alsa-devel libgcrypt-devel libgnutls-devel libjson-c-devel file-devel mxml-devel
+ OpenSuse >=42.2, Fedora>=25, Ubuntu>=16.4 Binary packages from https://en.opensuse.org/LinuxAutomotive
- Ubuntu >= 16.4 libuuid-devel
- apt-get install cmake git electric-fence libsystemd-dev libssl-dev uuid-dev libasound2-dev libgcrypt20-dev libgnutls-dev libgnutls-dev libjson-c-dev libmagic-dev libmxml-dev
+ For other distro see # Building AFB-daemon from source on Standard Linux Distribution
+
+
+# Specific Dependencies
+
+ * alsa-devel >= 1.1.2 Warning some distro like Fedora-25 still ship version 1.1.1 as default
+ * lua >= 5.3 Most distribution only ship version 5.2 but binary package should be easy to find
- libmicrohttpd>=0.9.55 (as today OpenSuse-42.2 or Ubuntu-.16.4 ship older versions)
- afb-daemon from AGL Gerrit git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
```
- # Might want to add following variables into ~/.bashrc
- echo "#---------- AGL options Start ---------" >>~/.bashrc
- echo "# Object: AGL cmake option for binder/bindings" >>~/.bashrc
- echo "# Date: `date`" >>~/.bashrc
- echo 'export CC=gcc-5; export CXX=g++-5' >>~/.bashrc # if using gcc5
- echo 'export INSTALL_PREFIX=$HOME/opt' >>~/.bashrc
- echo 'export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
- echo 'export LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
- echo 'export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib64/pkgconfig:$INSTALL_PREFIX/lib/pkgconfig' >>~/.bashrc
- echo 'export PATH=$INSTALL_PREFIX/bin:$PATH' >>~/.bashrc
- echo 'export RSYNC_TARGET=MY_TARGET_HOSTNAME' >>~/.bashrc
- echo 'export RSYNC_PREFIX=./opt' >>~/.bashrc
+ 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
+```
- echo "#---------- AGL options End ---------" >>~/.bashrc
- source ~/.bashrc
- # install LibMicroHttpd
- LIB_MH_VERSION=0.9.55
- wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${LIB_MH_VERSION}.tar.gz
- tar -xzf libmicrohttpd-${LIB_MH_VERSION}.tar.gz
- cd libmicrohttpd-${LIB_MH_VERSION}
- ./configure --prefix=${INSTALL_PREFIX}
- make
- sudo make install-strip
+# Compile AGL-Advanced-Audio-Agent
+--------------------------------------
- # retrieve last AFB_daemon from AGL
- git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
+* Edit your ~/.config/app-templates/cmake.d/00-common-userconf.cmake to reflect your local configuration
- # Warning: previous GCC options should be set before initial cmake (clean Build/*)
- cd app-framework-binder; mkdir -p build; cd build
- cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
- make
- make install
```
+ message(STATUS "*** Fulup Local Config For Native Linux ***")
+ add_compile_options(-DNATIVE_LINUX)
+
+ set (RSYNC_TARGET "10.20.101.198")
+ set (RSYNC_PREFIX "opt")
+ set(CMAKE_INSTALL_PREFIX $ENV{HOME}/opt)
+ set(BINDINGS_INSTALL_PREFIX $ENV{HOME}/opt)
+
+ set(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/lib64/pkgconfig ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
+ set(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib)
+
+```
-# Compile binding
```
- source ~/.bashrc # or any other file where your have place your compilation preferences
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
@@ -121,8 +106,16 @@ from the wrong relative directory, either you have to use 'set solib-search-path
info sharedlibrary afb-*
```
+# ToBeBone (WorkInProgess: This list is getting longer every day)
+-------------------------------------------------------------------
+
+* Support response from LUA with nested table (currently fail miserably)
+* Add timer base callback from Lua
+* Enable export of LUA commands directly from Plugin
# Running an debugging on a target
+-------------------------------------------------------
+
```
export RSYNC_TARGET=root@xx.xx.xx.xx
@@ -148,3 +141,59 @@ Note: remote-target-populate will
Note that Netbeans impose to set debug directory to ./build/pkgout or it won't find binding symbols for source debugging
+# Building AFB-daemon from source on Standard Linux Distribution
+-------------------------------------------------------
+
+ # handle dependencies > (OpenSuse-42.2, Fedora-25, Ubuntu 16.04.2LTS)
+ gcc > 4.8
+ systemd-devel (libsystemd-dev>=222)
+ libuuid-devel
+ file-devel(OpenSuSe) or libmagic-dev(Ubuntu)
+ libjson-c-devel
+ ElectricFence (BUG should not be mandatory)
+ libopenssl-devel libgcrypt-devel libgnutls-devel (optional but requested by libmicrohttpd for https)
+
+ OpenSuse >=42.2
+ zypper in gcc5 gdb gcc5-c++ git cmake make ElectricFence systemd-devel libopenssl-devel libuuid-devel alsa-devel libgcrypt-devel libgnutls-devel libjson-c-devel file-devel mxml-devel
+
+ Ubuntu >= 16.4 libuuid-devel
+ apt-get install cmake git electric-fence libsystemd-dev libssl-dev uuid-dev libasound2-dev libgcrypt20-dev libgnutls-dev libgnutls-dev libjson-c-dev libmagic-dev libmxml-dev
+
+ libmicrohttpd>=0.9.55 (as today OpenSuse-42.2 or Ubuntu-.16.4 ship older versions)
+ afb-daemon from AGL Gerrit git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
+
+```
+ # Might want to add following variables into ~/.bashrc
+ echo "#---------- AGL options Start ---------" >>~/.bashrc
+ echo "# Object: AGL cmake option for binder/bindings" >>~/.bashrc
+ echo "# Date: `date`" >>~/.bashrc
+ echo 'export CC=gcc-5; export CXX=g++-5' >>~/.bashrc # if using gcc5
+ echo 'export INSTALL_PREFIX=$HOME/opt' >>~/.bashrc
+ echo 'export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
+ echo 'export LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
+ echo 'export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib64/pkgconfig:$INSTALL_PREFIX/lib/pkgconfig' >>~/.bashrc
+ echo 'export PATH=$INSTALL_PREFIX/bin:$PATH' >>~/.bashrc
+ echo 'export RSYNC_TARGET=MY_TARGET_HOSTNAME' >>~/.bashrc
+ echo 'export RSYNC_PREFIX=./opt' >>~/.bashrc
+
+ echo "#---------- AGL options End ---------" >>~/.bashrc
+ source ~/.bashrc
+
+ # install LibMicroHttpd
+ LIB_MH_VERSION=0.9.55
+ wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${LIB_MH_VERSION}.tar.gz
+ tar -xzf libmicrohttpd-${LIB_MH_VERSION}.tar.gz
+ cd libmicrohttpd-${LIB_MH_VERSION}
+ ./configure --prefix=${INSTALL_PREFIX}
+ make
+ sudo make install-strip
+
+ # retrieve last AFB_daemon from AGL
+ git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
+
+ # Warning: previous GCC options should be set before initial cmake (clean Build/*)
+ cd app-framework-binder; mkdir -p build; cd build
+ cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
+ make
+ make install
+```
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100644
index 0000000..55ee664
--- /dev/null
+++ b/data/CMakeLists.txt
@@ -0,0 +1,46 @@
+###########################################################################
+# Copyright 2017 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.
+###########################################################################
+
+
+
+##################################################
+# Control Policy Config file
+##################################################
+PROJECT_TARGET_ADD(Control_config)
+
+ file(GLOB XML_FILES "*.json")
+
+ add_custom_target(${TARGET_NAME}
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ )
+
+ # check XML schema before pushing config
+ add_custom_command(
+ DEPENDS ${XML_FILES}
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ # COMMAND xmllint -schema ${XML_SCHEMA} ${XML_FILES} --noout (Fulup we miss this for JSON)
+ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ COMMAND cp -r ${XML_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ )
+
+ SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+ LABELS "DATA"
+ OUTPUT_NAME ${TARGET_NAME}
+ )
diff --git a/data/default-control-policy.json b/data/default-control-policy.json
new file mode 100644
index 0000000..30cd1ce
--- /dev/null
+++ b/data/default-control-policy.json
@@ -0,0 +1,90 @@
+{
+ "$schema": "ToBeDone",
+ "metadata": {
+ "label": "sample-audio-policy",
+ "info": "Provide Default Audio Policy for Multimedia, Navigation and Emergency",
+ "version": "1.0"
+ },
+ "onload": {
+ "info": "controler initialisation config",
+ "plugin": "sample-audio-policy.so",
+ "actions": [
+ {
+ "info": "Call policy sharelib install entrypoint",
+ "callback": "SamplePolicyInstall",
+ "query": {"arg1" : "first_arg", "nextarg": "second arg value"}
+ }, {
+ "info": "Assert AlsaCore Presence",
+ "api": "alsacore",
+ "verb": "ping"
+ }
+ ]
+ },
+ "controls":
+ [{
+ "label": "multimedia",
+ "actions": [
+ {
+ "label": "multimedia-policy-cb",
+ "info": "Call Sharelib Sample Callback",
+ "callback": "samplePolicyCB",
+ "query": {
+ "arg1": "snoopy",
+ "arg2": "toto"
+ }
+ }, {
+ "label": "multimedia-policy-ucm",
+ "info": "Subcall AlSA UCM navigation",
+ "api": "alsacore",
+ "verb": "ucmset",
+ "query": {
+ "verb": "multimedia"
+ }
+ }
+ ]
+ },
+ {
+ "label":"navigation",
+ "action" : {
+ "api": "alsacore",
+ "verb": "ucmset",
+ "query": {
+ "verb": "navigation"
+ },
+ "optional": true,
+ "timeout": 100
+ }
+ }, {
+ "label":"emergency",
+ "action": {
+ "api": "alsacore",
+ "verb": "ucmset",
+ "query": {
+ "verb": "emergency"
+ }
+ }
+ }]
+ ,
+ "events": [
+ {
+ "label": "SampleEvent",
+ "comment": "define action when receiving a given event",
+ "actions": [
+ {
+ "info": "Event Callback-1",
+ "callback": "ProcessEventCB",
+ "query": {
+ "arg": "action-1"
+ }
+ }, {
+ "info": "Event Callback-2",
+ "callback": "ProcessEventCB",
+ "query": {
+ "arg": "action-2"
+ }
+ }
+ ]
+ }
+ ]
+}
+
diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml
index 62a0f3d..8d0b065 100644
--- a/nbproject/configurations.xml
+++ b/nbproject/configurations.xml
@@ -117,8 +117,8 @@
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<flagsDictionary>
- <element flagsID="0" commonFlags="-g -fPIC -fPIC"/>
- <element flagsID="1" commonFlags="-g -fPIC -fPIC -g"/>
+ <element flagsID="0" commonFlags="-g -fPIC -fPIC -g"/>
+ <element flagsID="1" commonFlags="-g -fPIC -fPIC -g -ggdb"/>
<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,7 +133,7 @@
<buildCommand>${MAKE} -f Makefile install</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
<executablePath>build/CMakeFiles/feature_tests.bin</executablePath>
- <cTool flags="0">
+ <cTool flags="-g -fPIC -fPIC">
<incDir>
<pElem>../../../opt/include</pElem>
<pElem>../../../opt/include/alsa</pElem>
@@ -149,7 +149,7 @@
<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>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>
@@ -167,43 +167,43 @@
ex="false"
tool="0"
flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Alsa-afb/Alsa-AddCtl.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Alsa-afb/Alsa-ApiHat.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Alsa-afb/Alsa-RegEvt.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Alsa-afb/Alsa-SetGet.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Alsa-afb/Alsa-Ucm.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Audio-Common/audio-common.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Audio-Common/wrap-json.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="Common/AudioCommonLib.c" ex="false" tool="0" flavor2="2">
- <cTool flags="1">
+ <cTool flags="0">
</cTool>
</item>
<item path="Controler-afb/ctl-binding.c" ex="false" tool="0" flavor2="0">
- <cTool flags="0">
+ <cTool flags="1">
<incDir>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
@@ -214,7 +214,7 @@
</cTool>
</item>
<item path="Controler-afb/ctl-dispatch.c" ex="false" tool="0" flavor2="2">
- <cTool flags="0">
+ <cTool flags="1">
<incDir>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
@@ -225,7 +225,7 @@
</cTool>
</item>
<item path="Controler-afb/ctl-events.c" ex="false" tool="0" flavor2="2">
- <cTool flags="0">
+ <cTool flags="1">
<incDir>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
@@ -236,7 +236,7 @@
</cTool>
</item>
<item path="Controler-afb/ctl-lua.c" ex="false" tool="0" flavor2="2">
- <cTool flags="0">
+ <cTool flags="1">
<incDir>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
@@ -247,7 +247,7 @@
</cTool>
</item>
<item path="Controler-afb/ctl-misc.c" ex="false" tool="0" flavor2="2">
- <cTool flags="0">
+ <cTool flags="1">
<incDir>
<pElem>Audio-Common</pElem>
<pElem>build/Controler-afb</pElem>
@@ -258,7 +258,7 @@
</cTool>
</item>
<item path="Controler-afb/ctl-plugin-sample.c" ex="false" tool="0" flavor2="2">
- <cTool flags="0">
+ <cTool flags="1">
<incDir>
<pElem>build/Controler-afb</pElem>
</incDir>
@@ -271,18 +271,18 @@
ex="false"
tool="0"
flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="HAL-afb/HAL-interface/hal-volramp.c"
ex="false"
tool="0"
flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="HAL-afb/HAL-interface/hal-volume.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="HAL-afb/HAL-plugin/HalPlugPcm.c" ex="false" tool="0" flavor2="3">
@@ -290,21 +290,21 @@
</cTool>
</item>
<item path="HAL-afb/HDA-intel/IntelHdaHAL.c" ex="false" tool="0" flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="HAL-afb/Jabra-Solemate/JabraUsbHAL.c"
ex="false"
tool="0"
flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="HAL-afb/Scarlett-Focusrite/ScarlettUsbHAL.c"
ex="false"
tool="0"
flavor2="3">
- <cTool flags="0">
+ <cTool flags="1">
</cTool>
</item>
<item path="HAL-afb/Unicens-USB/UnicensHAL.c" ex="false" tool="0" flavor2="3">
@@ -373,6 +373,7 @@
</incDir>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
<Elem>PIC</Elem>
<Elem>policy_hook_cb_EXPORTS</Elem>
</preprocessorList>
@@ -386,6 +387,7 @@
</incDir>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
<Elem>alsa_lowlevel_EXPORTS</Elem>
</preprocessorList>
</cTool>
@@ -398,6 +400,7 @@
</incDir>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
</preprocessorList>
</cTool>
</folder>
@@ -413,6 +416,7 @@
<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>
@@ -422,6 +426,7 @@
<cTool>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
</preprocessorList>
</cTool>
</folder>
@@ -434,6 +439,7 @@
</incDir>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
</preprocessorList>
</cTool>
</folder>
@@ -449,6 +455,7 @@
<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>
@@ -463,6 +470,7 @@
</incDir>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
<Elem>hal_intel_hda_EXPORTS</Elem>
</preprocessorList>
</cTool>
@@ -476,6 +484,7 @@
</incDir>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
<Elem>hal_jabra_usb_EXPORTS</Elem>
</preprocessorList>
</cTool>
@@ -489,6 +498,7 @@
</incDir>
<preprocessorList>
<Elem>CONTROL_DOSCRIPT_PRE="doscript"</Elem>
+ <Elem>NATIVE_LINUX</Elem>
<Elem>hal_scalett_usb_EXPORTS</Elem>
</preprocessorList>
</cTool>
@@ -505,6 +515,7 @@
<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>
@@ -522,6 +533,7 @@
<pElem>build/HighLevel-afb</pElem>
</incDir>
<preprocessorList>
+ <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>
@@ -535,6 +547,7 @@
<pElem>build/HAL-afb/HAL-plugin</pElem>
</incDir>
<preprocessorList>
+ <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>