X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=docs%2Fafb-binding-writing.md;h=3e4abe321bca3d74a8a199d198d312c4de2fdc47;hb=87446697d54dd1eebe2f4b5528520af7a0e8f027;hp=69090e3dbcb7f1036d4a824347bca132837c89fa;hpb=4521c1e7ae5371ab9d639adc617d17fb4e8ded0c;p=src%2Fapp-framework-binder.git diff --git a/docs/afb-binding-writing.md b/docs/afb-binding-writing.md index 69090e3d..3e4abe32 100644 --- a/docs/afb-binding-writing.md +++ b/docs/afb-binding-writing.md @@ -1,21 +1,20 @@ # Overview of the bindings -The ***binder*** serves files through HTTP protocol and offers to -developers the capability to offer application API methods through HTTP or +The ***binder*** serves files through HTTP protocol and offers developers the capability to offer application API methods through HTTP or WebSocket protocol. The ***bindings*** are used to add **API** to ***binders***. This part describes how to write a ***binding*** for ***binder*** or in other words how to add a new **API** to the system. -Excepting this summary, this section target developers. +This section target developers. This section shortly explain how to write a binding using the C programming language. It is convenient to install the ***binder*** on the desktop used for writing the binding. -It allows easy debug and test. +It allows for easy debug and test. ## Nature of a binding @@ -28,7 +27,7 @@ The **API** is designated and accessed through its name. It contains several **verbs** that implement the ***binding*** functionalities. Each of these **verbs** is a **method** that -processes requests of applications and sends result. +processes requests of applications and sends results. The ***binding***'s methods are invoked by HTTP or websocket requests. @@ -106,7 +105,7 @@ gcc -fPIC -shared tuto-1.c -o tuto-1.so $(pkg-config --cflags-only-I afb-daemon) Running: ```bash -afb-daemon --binding tuto-1.so --port 3333 --token '' +afb-daemon --binding ./tuto-1.so --port 3333 --token '' ``` At this point, afb-daemon has started, it loaded the binding tuto-1.so and now @@ -139,7 +138,7 @@ This shows basic things: - The include to get for creating a binding - How to declare the API offered by the binding -- How to handle request made to the binding +- How to handle requests made to the binding ### Getting declarations for the binding @@ -357,7 +356,7 @@ gcc -fPIC -shared tuto-2.c -o tuto-2.so $(pkg-config --cflags --libs afb-daemon) Running: ```bash -afb-daemon --binding tuto-2.so --port 3333 --token '' +afb-daemon --binding ./tuto-2.so --port 3333 --token '' ``` Testing: @@ -402,7 +401,7 @@ ON-REPLY 4:tuto-2/action: OK } ``` -In an other terminal: +In another terminal: ```bash $ afb-client-demo -H localhost:3333/api?token=toto