diff options
Diffstat (limited to 'htdocs')
-rw-r--r-- | htdocs/CMakeLists.txt | 25 | ||||
-rw-r--r-- | htdocs/alsa-core.html | 3 | ||||
-rw-r--r-- | htdocs/audio-logic.html | 40 | ||||
-rw-r--r-- | htdocs/index.html | 1 |
4 files changed, 67 insertions, 2 deletions
diff --git a/htdocs/CMakeLists.txt b/htdocs/CMakeLists.txt new file mode 100644 index 0000000..22a4d63 --- /dev/null +++ b/htdocs/CMakeLists.txt @@ -0,0 +1,25 @@ +########################################################################### +# Copyright 2015, 2016, 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. +########################################################################### + + + + +################################################## +# HTML Testing Files +################################################## +install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} DESTINATION . FILES_MATCHING PATTERN "*.html" PATTERN "*.js" PATTERN "*.jpg") diff --git a/htdocs/alsa-core.html b/htdocs/alsa-core.html index e408a01..0969b6f 100644 --- a/htdocs/alsa-core.html +++ b/htdocs/alsa-core.html @@ -15,7 +15,7 @@ document.getElementById("connected").innerHTML = "Connected Closed"; } function init() { - ws = new AfbWsItf("api", onopen, onabort, new AfbCtxItf("hello")); + ws = new AfbWsItf("api", onopen, onabort, new AfbCtxItf("mysecret")); } function replyok(obj) { document.getElementById("output").innerHTML = "OK: "+JSON.stringify(obj); @@ -38,6 +38,5 @@ <li><a href="api/alsacore/getctl?devid=hw:0&numid=1&quiet=0">return control numid=1 for hw:0</a> <li><button id="connected" onclick="subscribe('hw:0')">Click to Connected</button></li> <div id="main" style="visibility:hidden"> - <p>Event Output</p> Server says... <div id="output"></div> </div> diff --git a/htdocs/audio-logic.html b/htdocs/audio-logic.html new file mode 100644 index 0000000..ff806ad --- /dev/null +++ b/htdocs/audio-logic.html @@ -0,0 +1,40 @@ +<html> +<head> + <title>Hello world test</title> + + <script type="text/javascript" src="websock.js"></script> + <script type="text/javascript"> + var ws; + + function onopen() { + document.getElementById("main").style.visibility = "visible"; + document.getElementById("connected").innerHTML = "WebSocket Open"; + } + function onabort() { + document.getElementById("main").style.visibility = "hidden"; + document.getElementById("connected").innerHTML = "Connected Closed"; + } + function init() { + ws = new AfbWsItf("api", onopen, onabort, new AfbCtxItf("mysecret")); + } + function replyok(obj) { + document.getElementById("output").innerHTML = "OK: "+JSON.stringify(obj); + } + function replyerr(obj) { + document.getElementById("output").innerHTML = "ERROR: "+JSON.stringify(obj); + } + function subscribe(devid) { + ws.call("alsacore", "subctl", {devid:devid}, replyok, replyerr); + } + </script> + +<body onload="init();"> + <h1>Hello world test</h1> + <ol> + <li><a href="api/audio/setvol?devid=hw:0&pcm=master&vol=50%">Set Master PCM volume to 50%</a> + <li><a href="api/audio/getvol?devid=hw:0&pcm=master">Get Master PCM volume</a> + <li><a href="api/alsacore/monitor?devid=hw:0">Activate devid=hw:0 monitoring</a> + <li><button id="connected" onclick="subscribe('hw:0')">Click to Subscribe</button></li> + <div id="main" style="visibility:hidden"> + Server says... <div id="output"></div> + </div> diff --git a/htdocs/index.html b/htdocs/index.html index dfb3c71..330ef4d 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -5,3 +5,4 @@ <h1>audio-bindings test</h1> <ol> <li><a href="alsa-core.html">AlsaCore Low Level Binding</a> + <li><a href="audio-logic.html">AudioLogic High level business API</a> |