aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2016-11-24 18:02:18 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2016-11-24 18:02:18 +0000
commitb8e62d9f981f7e9893553a79d089f1aa8be265ba (patch)
treec02b4fdc88bc7245ee004124cc9abbff115b3717
parent85f44017fb18205133d369bf16c5d0022984c510 (diff)
Add README file with install and tests instructions
Change-Id: I555c1c500090ec46d252e55136b2fb092a7d4970 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--README.md90
1 files changed, 90 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..783f43b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,90 @@
+HVAC bindings and client application for Application Framework Binder
+=====================================================================
+
+_(Application Framework Binder can be found on https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-binder)_
+
+Installation
+------------
+
+Download and install IoT.bzh docker image and sdk.
+
+ 1. Follow [this guide](http://iot.bzh/download/public/2016/sdk/AGL-Devkit-Image-and-SDK-for-porter.pdf)
+ to get your docker ready and running.
+
+ 2. Check out this repository
+ git clone https://gerrit.automotivelinux.org/gerrit/src/hvacplugin -c b sandbox/claneys/hvac-bindings
+
+Build project
+-------------
+
+Get into build directory under hvacplugin repo and build the widget:
+
+ - cd hvacplugin/build
+
+ - cmake .. && make
+
+It will build the binding with QML Frontend and package all that into a wgt file
+named : hvac-hybrid-qml.wgt
+
+Install and test the widget
+--------------------------
+
+### Installation
+
+Transfer the wgt file on your platform with scp :
+
+```C
+ $ scp hvac-hybrid-qml.wgt root@<your_porter_board>:/tmp
+
+```
+than install it using afm-util:
+
+```C
+ # afm-util install /tmp/hvac-hybrid-qml.wgt
+ { "added": "hvac-hybrid-qml@0.1" }
+
+```
+### Test
+
+You can launch bindings using the afb-daemoni, starting them manually like this,
+don't forget to change <chosen_port> and <chosen_token> by your choice using an
+unused port and a random number for the security token:
+
+```C
+# /usr/bin/afb-daemon --ldpaths=/usr/lib/afb:/usr/share/afm/applications/hvac-hybrid-qml/0.1/lib --mode=local --readyfd=8 --alias=/icons:/usr/share/afm/icons --port=<chosen_port> --rootdir=/usr/share/afm/applications/hvac-hybrid-qml/0.1 --roothttp=htdocs --token=<chosen_token> --sessiondir=/home/root/app-data/hvac-hybrid-qml/.afb-daemon &
+NOTICE: binding [/usr/lib/afb/afb-dbus-binding.so] calling registering function afbBindingV1Register
+NOTICE: binding /usr/lib/afb/afb-dbus-binding.so loaded with API prefix dbus
+NOTICE: binding [/usr/lib/afb/authLogin.so] calling registering function afbBindingV1Register
+NOTICE: binding /usr/lib/afb/authLogin.so loaded with API prefix auth
+NOTICE: binding [/usr/share/afm/applications/hvac-hybrid-qml/0.1/lib/hvac-hybrid-qml.so] calling registering function afbBindingV1Register
+NOTICE: binding /usr/share/afm/applications/hvac-hybrid-qml/0.1/lib/hvac-hybrid-qml.so loaded with API prefix hvac
+NOTICE: Waiting port=12357 rootdir=/usr/share/afm/applications/hvac-hybrid-qml/0.1
+NOTICE: Browser URL= http:/*localhost:12357
+```
+
+With bindings launched you can now test them using afm-demo-client as you have
+to communicate with bindings using WebSocket protocol. When connection
+established you can dialog with binding using api/verbs from application
+framework and running bindings. At first, try to authenticate with ```auth
+connect``` which will renew token and create a new session context for the running
+app.
+
+Then test following verbs using api ***hvac***:
+
+ - ping : Ping the binder
+ - get_temp_left_zone : Get the left zone temperature
+ - get_temp_right_zone : Get the right zone temperature
+ - set_temp_left_zone : Set the left zone temperature
+ - set_temp_right_zone : Set the right zone temperature
+ - set_fanspeed : Set fanspeed
+ - get_fanspeed : Read fan speed
+ - get_all : Read all values
+
+```C
+# afb-client-demo ws://localhost:<chosen_port>/api?token=<chosen_token>
+auth connect
+ON-REPLY 1:auth/connect: {"response":{"token":"A New Token and Session Context Was Created"},"jtype":"afb-reply","request":{"status":"success","token":"4dc950c6-856d-4cff-81e7-f914b4319008","uuid":"7a687f25-90db-4d4f-8881-2e505c151176"}}
+hvac get_all
+ON-REPLY 2:hvac/get_all: {"response":{"LeftTemperature":21,"RightTemperature":21,"FanSpeed":0},"jtype":"afb-reply","request":{"status":"success"}}
+
+```