summaryrefslogtreecommitdiffstats
path: root/doc/afb-application-writing.html
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-05-30 13:22:34 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-05-30 13:36:47 +0200
commit0156b1645a201e44d5285c96d32cbfa5a9eb6814 (patch)
treeb249c14ce158161b2100603c7301a55ba8bd3a3d /doc/afb-application-writing.html
parentb41ed8f8cbbdf7cff415f69f6f9b4a92cfe1f37d (diff)
Improves the documentation
Change-Id: Iac5ee5c2ca014ced5fe836601e9afc362a9d4fda Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'doc/afb-application-writing.html')
-rw-r--r--doc/afb-application-writing.html68
1 files changed, 67 insertions, 1 deletions
diff --git a/doc/afb-application-writing.html b/doc/afb-application-writing.html
index adb5ca7b..7c0278da 100644
--- a/doc/afb-application-writing.html
+++ b/doc/afb-application-writing.html
@@ -8,18 +8,63 @@
<h1>HOWTO WRITE an APPLICATION above AGL FRAMEWORK</h1>
<pre><code>version: 1
-Date: 29 mai 2016
+Date: 30 mai 2016
Author: José Bollo
</code></pre>
<p><ul>
<li><a href="#HOWTO.WRITE.an.APPLICATION.above.AGL.FRAMEWORK">HOWTO WRITE an APPLICATION above AGL FRAMEWORK</a>
<ul>
+ <li><a href="#Writing.an.HTML5.application">Writing an HTML5 application</a></li>
+ <li><a href="#Writing.a.Qt.application">Writing a Qt application</a></li>
<li><a href="#Writing.a.C.application">Writing a C application</a></li>
+ <li><a href="#Handling.sessions.within.applications">Handling sessions within applications</a>
+ <ul>
+ <li><a href="#Exchanging.tokens">Exchanging tokens</a></li>
+ <li><a href="#Handling.sessions">Handling sessions</a></li>
+ </ul>
+ </li>
</ul>
</li>
</ul></p>
+<a name="Writing.an.HTML5.application"></a>
+<h2>Writing an HTML5 application</h2>
+
+<p>Developpers of HTML5 applications (client side) can easyly create
+applications for AGL framework using their prefered
+HTML framework.</p>
+
+<p>Developpers can also create powerful server side plugins to improve
+their application. This server side plugin should return the mime-type
+application/json and can be accessed either by HTTP or by Websockets.</p>
+
+<p>In a near future, the JSON-RPC protocol will be available together
+with the current x-afb-json1 protocol.</p>
+
+<p>Two examples of HTML5 applications are given:</p>
+
+<ul>
+<li><p><a href="https://github.com/iotbzh/afb-client">afb-client</a> a simple &ldquo;hello world&rdquo; application</p></li>
+<li><p><a href="https://github.com/iotbzh/afm-client">afm-client</a> a simple &ldquo;Home screen&rdquo; application</p></li>
+</ul>
+
+
+<a name="Writing.a.Qt.application"></a>
+<h2>Writing a Qt application</h2>
+
+<p>Writing Qt applications is also possible because Qt offers APIs to
+make HTTP queries and to connect using WebSockets.</p>
+
+<p>It is even possible to write a QML application.
+It is demontrated by the sample application token-websock:</p>
+
+<ul>
+<li><a href="https://github.com/iotbzh/afb-daemon/blob/master/test/token-websock.qml">token-websock</a>
+a simple &ldquo;hello world&rdquo; application in QML</li>
+</ul>
+
+
<a name="Writing.a.C.application"></a>
<h2>Writing a C application</h2>
@@ -36,5 +81,26 @@ Its source code is here
<p>The current implementation use libsystemd and file descriptors.
This may be changed in the future to also support secure sockets
and being less dependant of libsystemd.</p>
+
+<a name="Handling.sessions.within.applications"></a>
+<h2>Handling sessions within applications</h2>
+
+<a name="Exchanging.tokens"></a>
+<h3>Exchanging tokens</h3>
+
+<p>Applications are communicating with their binder afb-daemon using
+a network connection or a kind of network connection (unix domain
+socket isn&rsquo;t currently implemented but could be used in near future).
+Also, HTTP protocol is not a connected protocol. It means that
+the socket connection can not be used to authenticate a client.</p>
+
+<p>For this reason, the binder should authenticate the application
+by using a commonly shared secret named token.</p>
+
+<p>At start, the framework communicate a common secret to both the binder
+and its client: the application. When the application</p>
+
+<a name="Handling.sessions"></a>
+<h3>Handling sessions</h3>
</body>
</html>