From 4ca8fd4015479fa758a789d137a693c30fec8cae Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Aug 2017 10:49:51 +0200 Subject: Moved FileConfigScan to AudioCommon and Documentation --- Alsa-Plugin/Alsa-Policy-Hook/PolicyHookCb.c | 135 ++++---- Alsa-Plugin/Alsa-Policy-Hook/README.md | 22 +- Alsa-Plugin/_Alsa-Hal-plugin/README.md | 4 +- Audio-Common/CMakeLists.txt | 2 +- Audio-Common/audio-common.h | 3 + Audio-Common/filescan-utils.c | 121 +++++++ Audio-Common/filescan-utils.h | 41 +++ Controler-afb/CMakeLists.txt | 3 +- Controler-afb/README.md | 234 ++++++++++++++ Controler-afb/ctl-apidef.h | 71 ++--- Controler-afb/ctl-apidef.json | 48 +-- Controler-afb/ctl-binding.h | 12 +- Controler-afb/ctl-dispatch.c | 1 - Controler-afb/ctl-events.c | 2 +- Controler-afb/ctl-lua.c | 117 ++++--- Controler-afb/ctl-misc.c | 122 ------- README.md | 5 + conf.d/project/config.d/onload-audio-control.json | 28 +- conf.d/project/lua.d/onload-audio-controls.lua | 23 +- htdocs/audio-control.html | 2 +- nbproject/configurations.xml | 372 ++++++++++++++++++---- nbproject/project.xml | 3 + 22 files changed, 951 insertions(+), 420 deletions(-) create mode 100644 Audio-Common/filescan-utils.c create mode 100644 Audio-Common/filescan-utils.h create mode 100644 Controler-afb/README.md delete mode 100644 Controler-afb/ctl-misc.c 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 @@ -72,6 +73,11 @@ typedef struct { void *afbClient; } afbRequestT; +typedef struct { + const char *name; + int signal; +} afbEventT; + typedef struct { snd_pcm_t *pcm; const char *uri; @@ -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 #include +#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/Audio-Common/filescan-utils.c b/Audio-Common/filescan-utils.c new file mode 100644 index 0000000..9fa121b --- /dev/null +++ b/Audio-Common/filescan-utils.c @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2016 "IoT.bzh" + * Author Fulup Ar Foll + * + * 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. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +#include "audio-common.h" + + + +// List Avaliable Configuration Files +PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext) { + json_object *responseJ; + char *dirPath; + char* dirList= strdup(searchPath); + size_t extLen=0; + + void ScanDir (char *searchPath) { + DIR *dirHandle; + struct dirent *dirEnt; + dirHandle = opendir (searchPath); + if (!dirHandle) { + AFB_DEBUG ("CONFIG-SCANNING dir=%s not readable", searchPath); + return; + } + + //AFB_NOTICE ("CONFIG-SCANNING:ctl_listconfig scanning: %s", searchPath); + while ((dirEnt = readdir(dirHandle)) != NULL) { + + // recursively search embedded directories ignoring any directory starting by '.' or '_' + if (dirEnt->d_type == DT_DIR && mode == CTL_SCAN_RECURSIVE) { + char newpath[CONTROL_MAXPATH_LEN]; + if (dirEnt->d_name[0]=='.' || dirEnt->d_name[0]=='_') continue; + + strncpy(newpath, searchPath, sizeof(newpath)); + strncat(newpath, "/", sizeof(newpath)); + strncat(newpath, dirEnt->d_name, sizeof(newpath)); + ScanDir(newpath); + continue; + } + + // Unknown type is accepted to support dump filesystems + if (dirEnt->d_type == DT_REG || dirEnt->d_type == DT_UNKNOWN) { + + // check prefix and extention + size_t extIdx=strlen(dirEnt->d_name)-extLen; + if (extIdx <= 0) continue; + if (pre && !strcasestr (dirEnt->d_name, pre)) continue; + if (ext && strcasecmp (ext, &dirEnt->d_name[extIdx])) continue; + + struct json_object *pathJ = json_object_new_object(); + json_object_object_add(pathJ, "fullpath", json_object_new_string(searchPath)); + json_object_object_add(pathJ, "filename", json_object_new_string(dirEnt->d_name)); + json_object_array_add(responseJ, pathJ); + } + } + closedir(dirHandle); + } + + if (ext) extLen=strlen(ext); + responseJ = json_object_new_array(); + + // loop recursively on dir + for (dirPath= strtok(dirList, ":"); dirPath && *dirPath; dirPath=strtok(NULL,":")) { + ScanDir (dirPath); + } + + free (dirList); + return (responseJ); +} + +PUBLIC const char *GetMidleName(const char*name) { + char *fullname = strdup(name); + + for (int idx = 0; fullname[idx] != '\0'; idx++) { + int start; + if (fullname[idx] == '-') { + start = idx + 1; + for (int jdx = start; fullname[jdx] != '\0'; jdx++) { + if (fullname[jdx] == '-') { + fullname[jdx] = '\0'; + return &fullname[start]; + break; + } + } + break; + } + } + return ""; +} + +PUBLIC const char *GetBinderName() { + char psName[17]; + static char *binderName=NULL; + + if (binderName) return binderName; + + // retrieve binder name from process name afb-name-trailer + prctl(PR_GET_NAME, psName,NULL,NULL,NULL); + binderName=GetMidleName(psName); + + return binderName; +} \ No newline at end of file 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 + * + * 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 #include +#include +#include #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 #include -#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 - * - * 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. - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include - -#include "audio-common.h" -#include "ctl-binding.h" - - - -// List Avaliable Configuration Files -PUBLIC json_object* ScanForConfig (char* searchPath, CtlScanDirModeT mode, char *pre, char *ext) { - json_object *responseJ; - char *dirPath; - char* dirList= strdup(searchPath); - size_t extLen=0; - - void ScanDir (char *searchPath) { - DIR *dirHandle; - struct dirent *dirEnt; - dirHandle = opendir (searchPath); - if (!dirHandle) { - AFB_DEBUG ("CONFIG-SCANNING dir=%s not readable", searchPath); - return; - } - - //AFB_NOTICE ("CONFIG-SCANNING:ctl_listconfig scanning: %s", searchPath); - while ((dirEnt = readdir(dirHandle)) != NULL) { - - // recursively search embedded directories ignoring any directory starting by '.' or '_' - if (dirEnt->d_type == DT_DIR && mode == CTL_SCAN_RECURSIVE) { - char newpath[CONTROL_MAXPATH_LEN]; - if (dirEnt->d_name[0]=='.' || dirEnt->d_name[0]=='_') continue; - - strncpy(newpath, searchPath, sizeof(newpath)); - strncat(newpath, "/", sizeof(newpath)); - strncat(newpath, dirEnt->d_name, sizeof(newpath)); - ScanDir(newpath); - continue; - } - - // Unknown type is accepted to support dump filesystems - if (dirEnt->d_type == DT_REG || dirEnt->d_type == DT_UNKNOWN) { - - // check prefix and extention - size_t extIdx=strlen(dirEnt->d_name)-extLen; - if (extIdx <= 0) continue; - if (pre && !strcasestr (dirEnt->d_name, pre)) continue; - if (ext && strcasecmp (ext, &dirEnt->d_name[extIdx])) continue; - - struct json_object *pathJ = json_object_new_object(); - json_object_object_add(pathJ, "fullpath", json_object_new_string(searchPath)); - json_object_object_add(pathJ, "filename", json_object_new_string(dirEnt->d_name)); - json_object_array_add(responseJ, pathJ); - } - } - closedir(dirHandle); - } - - if (ext) extLen=strlen(ext); - responseJ = json_object_new_array(); - - // loop recursively on dir - for (dirPath= strtok(dirList, ":"); dirPath && *dirPath; dirPath=strtok(NULL,":")) { - ScanDir (dirPath); - } - - free (dirList); - return (responseJ); -} - -PUBLIC const char *GetMidleName(const char*name) { - char *fullname = strdup(name); - - for (int idx = 0; fullname[idx] != '\0'; idx++) { - int start; - if (fullname[idx] == '-') { - start = idx + 1; - for (int jdx = start; fullname[jdx] != '\0'; jdx++) { - if (fullname[jdx] == '-') { - fullname[jdx] = '\0'; - return &fullname[start]; - break; - } - } - break; - } - } - return ""; -} - -PUBLIC const char *GetBinderName() { - char psName[17]; - static char *binderName=NULL; - - if (binderName) return binderName; - - // retrieve binder name from process name afb-name-trailer - prctl(PR_GET_NAME, psName,NULL,NULL,NULL); - binderName=GetMidleName(psName); - - return binderName; -} \ No newline at end of file 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 @@
  • -
  • +
  • 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 @@ audio-common.c + filescan-utils.c wrap-json.c @@ -117,8 +118,8 @@ false - - + + ${MAKE} -f Makefile install ${MAKE} -f Makefile clean build/CMakeFiles/feature_tests.bin - - - ../../../opt/include - ../../../opt/include/alsa - /usr/include/p11-kit-1 - /usr/include/json-c - /usr/include/lua5.3 - - - CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" - CONTROL_CONFIG_POST="control" - CONTROL_CONFIG_PRE="onload" - CONTROL_LUA_EVENT="luaevt" - CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" - CONTROL_MAXPATH_LEN=255 - CONTROL_ONLOAD_DEFAULT="onload-default" - 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" - CTL_PLUGIN_MAGIC=2468013579 - MAX_LINEAR_DB_SCALE=24 - MAX_SND_CARD=16 - TLV_BYTE_SIZE=256 - + @@ -167,102 +147,201 @@ ex="false" tool="0" flavor2="3"> - + - + - + - + - + - + - + - - + + - + - + + + + + + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Controler-afb + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + NATIVE_LINUX + TLV_BYTE_SIZE=256 control_afb_EXPORTS - - + + + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Controler-afb + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + NATIVE_LINUX + TLV_BYTE_SIZE=256 control_afb_EXPORTS - - + + + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Controler-afb + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + NATIVE_LINUX + TLV_BYTE_SIZE=256 control_afb_EXPORTS - - + + + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Controler-afb + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + NATIVE_LINUX + TLV_BYTE_SIZE=256 control_afb_EXPORTS - - + + - Audio-Common + ../../../opt/include/afb + Controler-afb + /usr/include/json-c build/Controler-afb - - control_afb_EXPORTS - - - + + + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 + Audio-Common build/Controler-afb + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + NATIVE_LINUX + TLV_BYTE_SIZE=256 audio_plugin_sample_EXPORTS @@ -271,18 +350,18 @@ ex="false" tool="0" flavor2="3"> - + - + - + @@ -290,21 +369,21 @@ - + - + - + @@ -369,12 +448,29 @@ + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 build/Alsa-Plugin/Alsa-Policy-Hook + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 NATIVE_LINUX PIC + TLV_BYTE_SIZE=256 policy_hook_cb_EXPORTS @@ -382,12 +478,29 @@ + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Alsa-afb + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 NATIVE_LINUX + TLV_BYTE_SIZE=256 alsa_lowlevel_EXPORTS @@ -395,18 +508,40 @@ + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Audio-Common + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 NATIVE_LINUX + TLV_BYTE_SIZE=256 + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Controler-afb build/HAL-afb/HAL-plugin @@ -416,17 +551,45 @@ CONTROL_CDEV_RX="/dev/inic-usb-crx" CONTROL_CDEV_TX="/dev/inic-usb-ctx" + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + TLV_BYTE_SIZE=256 audio_plugin_sample_EXPORTS control_afb_EXPORTS - + + + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 + - CONTROL_DOSCRIPT_PRE="doscript" - NATIVE_LINUX + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + TLV_BYTE_SIZE=256 @@ -455,7 +618,6 @@ CONTROL_CDEV_RX="/dev/inic-usb-crx" CONTROL_CDEV_TX="/dev/inic-usb-ctx" - CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" audio_plugin_sample_EXPORTS control_afb_EXPORTS @@ -515,7 +677,6 @@ CONTROL_CDEV_RX="/dev/inic-usb-crx" CONTROL_CDEV_TX="/dev/inic-usb-ctx" - CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" audio_plugin_sample_EXPORTS control_afb_EXPORTS @@ -524,6 +685,11 @@ + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Controler-afb build/HAL-afb/HAL-plugin @@ -533,7 +699,18 @@ build/HighLevel-afb + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + TLV_BYTE_SIZE=256 audio_plugin_sample_EXPORTS control_afb_EXPORTS @@ -542,12 +719,28 @@ + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 Audio-Common build/Controler-afb build/HAL-afb/HAL-plugin + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + TLV_BYTE_SIZE=256 audio_plugin_sample_EXPORTS control_afb_EXPORTS @@ -922,7 +1115,7 @@ false - + @@ -934,7 +1127,7 @@ ${MAKE} ${MAKE} clean - + @@ -1022,6 +1215,18 @@ + + + + + + + + + + + + ../../../opt/include/alsa /usr/include/p11-kit-1 /usr/include/json-c + /usr/include/lua5.3 build/Alsa-Plugin/Alsa-Policy-Hook - CONTROL_CDEV_RX="/dev/inic-usb-crx" - CONTROL_CDEV_TX="/dev/inic-usb-ctx" + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 MAX_LINEAR_DB_SCALE=24 MAX_SND_CARD=16 NATIVE_LINUX @@ -1181,6 +1395,36 @@ + + + + ../../../opt/include + ../../../opt/include/alsa + /usr/include/p11-kit-1 + /usr/include/json-c + /usr/include/lua5.3 + Audio-Common + build/Controler-afb + + + CONTROL_CONFIG_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/config.d:/usr/local/controler/config.d" + CONTROL_CONFIG_POST="control" + CONTROL_CONFIG_PRE="onload" + CONTROL_DOSCRIPT_PRE="doscript" + CONTROL_LUA_EVENT="luaevt" + CONTROL_LUA_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/conf.d/project/lua.d:/usr/local/controler/ctl-lua.d" + CONTROL_MAXPATH_LEN=255 + CONTROL_ONLOAD_DEFAULT="onload-default" + CONTROL_PLUGIN_PATH="/home/fulup/Workspace/AGL-AppFW/audio-bindings-dev/build:/home/fulup/opt/audio-bindings/ctlplug:/usr/lib/afb/ctlplug" + CTL_PLUGIN_MAGIC=2468013579 + MAX_LINEAR_DB_SCALE=24 + MAX_SND_CARD=16 + NATIVE_LINUX + TLV_BYTE_SIZE=256 + control_afb_EXPORTS + + + 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 @@ false + + Controler + -- cgit 1.2.3-korg