aboutsummaryrefslogtreecommitdiffstats
path: root/conf.d/project/json.d
diff options
context:
space:
mode:
Diffstat (limited to 'conf.d/project/json.d')
-rw-r--r--conf.d/project/json.d/CMakeLists.txt32
-rw-r--r--conf.d/project/json.d/onload-audio-control.json128
-rw-r--r--conf.d/project/json.d/onload-daemon-standalone.json72
3 files changed, 232 insertions, 0 deletions
diff --git a/conf.d/project/json.d/CMakeLists.txt b/conf.d/project/json.d/CMakeLists.txt
new file mode 100644
index 0000000..8070997
--- /dev/null
+++ b/conf.d/project/json.d/CMakeLists.txt
@@ -0,0 +1,32 @@
+###########################################################################
+# 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(ctl-config.d)
+
+ file(GLOB XML_FILES "*.json")
+
+ add_input_files("${XML_FILES}")
+
+ SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+ LABELS "DATA"
+ OUTPUT_NAME ${TARGET_NAME}
+ )
diff --git a/conf.d/project/json.d/onload-audio-control.json b/conf.d/project/json.d/onload-audio-control.json
new file mode 100644
index 0000000..77a8fce
--- /dev/null
+++ b/conf.d/project/json.d/onload-audio-control.json
@@ -0,0 +1,128 @@
+{
+ "$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-standalone.json b/conf.d/project/json.d/onload-daemon-standalone.json
new file mode 100644
index 0000000..de52c22
--- /dev/null
+++ b/conf.d/project/json.d/onload-daemon-standalone.json
@@ -0,0 +1,72 @@
+{
+ "$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"
+ }
+ }
+ }
+ ]
+}
+