From 4921883434749752ac82a0cbab8e6e57120800c5 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 23 Aug 2017 01:00:20 +0200 Subject: Restore Basic HTML5 testing Scenario as a Standalone Controller --- conf.d/project/json.d/README.md | 20 ++++ conf.d/project/json.d/onload-audio-control.json | 128 --------------------- conf.d/project/json.d/onload-daemon-sample.json | 69 +++++++++++ .../project/json.d/onload-daemon-standalone.json | 72 ------------ 4 files changed, 89 insertions(+), 200 deletions(-) create mode 100644 conf.d/project/json.d/README.md delete mode 100644 conf.d/project/json.d/onload-audio-control.json create mode 100644 conf.d/project/json.d/onload-daemon-sample.json delete mode 100644 conf.d/project/json.d/onload-daemon-standalone.json (limited to 'conf.d/project/json.d') diff --git a/conf.d/project/json.d/README.md b/conf.d/project/json.d/README.md new file mode 100644 index 0000000..153990c --- /dev/null +++ b/conf.d/project/json.d/README.md @@ -0,0 +1,20 @@ +By default controller searches for a config filename with the same 'middlename' as daemon process. As an example if your process name is afb-daemon then middle name is 'daemon'. + +``` + onload-middlename-xxxxx.json + + # Middlename is taken from process middlename. +``` + +You may overload config search path with environement variables + * AFB_BINDER_NAME: change patern config search path. 'export AFB_BINDER_NAME=sample' will make controller to search for a configfile name 'onload-sample-xxx.json'. + * CONTROL_CONFIG_PATH: change default reserch path for configuration. You may provide multiple directories separated by ':'. + * CONTROL_LUA_PATH: same as CONTROL_CONFIG_PATH but for Lua script files. + +Example to load a config name 'onload-myconfig-test.json' do +``` + AFB_BINDER_NAME='myconfig' afb-daemon --verbose ...' +``` + +Note: you may change search pattern for Lua script by adding 'ctlname=afb-middlename-xxx' in the metadata section of your config 'onload-*.json' + diff --git a/conf.d/project/json.d/onload-audio-control.json b/conf.d/project/json.d/onload-audio-control.json deleted file mode 100644 index 2e6da77..0000000 --- a/conf.d/project/json.d/onload-audio-control.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "$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": { - "label" : "_MyPlug", - "sharelib": "ctl-audio-plugin-sample.ctlso", - "lua2c": ["Lua2cHelloWorld1", "Lua2cHelloWorld2"] - }, - "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": {"data": "none"} - }, { - "label": "onload-hal-lua", - "info": "Load avaliable HALs", - "lua": "_Alsa_Get_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": "SampleEvent1", - "info": "define action when receiving a given event", - "actions": [ - { - "label": "Event Callback-1", - "callback": "SampleControlEvent", - "args": { - "arg": "action-1" - } - }, { - "label": "Event Callback-2", - "callback": "SampleControlEvent", - "args": { - "arg": "action-2" - } - } - ] - }, - { - "label": "SampleEvent2", - "info": "define action when receiving a given event", - "actions": [ - { - "label": "Event Callback-1", - "callback": "SampleControlEvent", - "args": { - "arg": "action-1" - } - }, { - "label": "Event Callback-2", - "callback": "SampleControlEvent", - "args": { - "arg": "action-2" - } - } - ] - } - ] -} - diff --git a/conf.d/project/json.d/onload-daemon-sample.json b/conf.d/project/json.d/onload-daemon-sample.json new file mode 100644 index 0000000..cb6ca55 --- /dev/null +++ b/conf.d/project/json.d/onload-daemon-sample.json @@ -0,0 +1,69 @@ +{ + "$schema": "ToBeDone", + "metadata": { + "label": "sample-standalone-control", + "info": "Minimal Standalone Controller Config", + "name": "afb-sample-controller", + "version": "1.0" + }, + "onload": [{ + "label": "onload-default", + "info": "onload initialisation config", + "actions": + { + "label": "control-init", + "lua": "_Sample_Controller_Init", + "args": { + "xxxx": 1234, + "yyyy": "Bien le bonjours à vous", + "zzzz": "simple-evt" + } + } + }], + "controls": + [ + { + "label": "Button-Happy", + "actions": { + "label": "Action Happy", + "lua": "_Button_Happy", + "args": { + "button": 5678 + } + } + }, { + "label": "Button-UnHappy", + "actions": { + "label": "Action Unhappy", + "lua": "_Button_UnHappy", + "args": { + "button": "abcd" + } + } + } + ], + "events": + [ + { + "label": "Event1", + "actions": { + "label": "Action Event 1", + "lua": "_Event_Received", + "args": { + "evtname": "xxx" + } + } + }, + { + "label": "Event2", + "actions": { + "label": "Action Event 2", + "lua": "_Event_Received", + "args": { + "evtname": "yyy" + } + } + } + ] +} + diff --git a/conf.d/project/json.d/onload-daemon-standalone.json b/conf.d/project/json.d/onload-daemon-standalone.json deleted file mode 100644 index ab646fd..0000000 --- a/conf.d/project/json.d/onload-daemon-standalone.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "$schema": "ToBeDone", - "metadata": { - "label": "sample-standalone-control", - "info": "Minimal Standalone Controller Config", - "version": "1.0" - }, - "onload": [{ - "label": "onload-default", - "info": "onload initialisation config", - "actions": - { - "label": "control-init", - "lua": "_Control_Init" - } - }], - "controls": - [ - { - "label": "Button-1", - "actions": { - "label": "Action on Button One", - "lua": "_Button_Press", - "args": { - "button": 1 - } - } - }, { - "label": "Button-1", - "actions": { - "label": "Action on Button Two", - "lua": "_Button_Press", - "args": { - "button": 2 - } - } - }, { - "label": "Button-1", - "actions": { - "label": "Action on Button Three", - "lua": "_Button_Press", - "args": { - "button": 3 - } - } - } - ], - "events": - [ - { - "label": "Event1", - "actions": { - "label": "Action Event 1", - "lua": "_Event_Received", - "args": { - "evtname": "xxx" - } - } - }, - { - "label": "Event2", - "actions": { - "label": "Action Event 2", - "lua": "_Event_Received", - "args": { - "evtname": "yyy" - } - } - } - ] -} - -- cgit 1.2.3-korg