From 3a1abbbff9f868324cca93f4bf03618552542391 Mon Sep 17 00:00:00 2001 From: Clément Bénier Date: Fri, 29 Jun 2018 18:22:55 +0200 Subject: README: add client demo example and fix some spellings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iba5fb857ae7e87aa8e2f142495e894aa634229b7 Signed-off-by: Clément Bénier --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85f97e5..852069c 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,50 @@ For now, there are 3 different events matching with the different available sens The frequency is in Hertz, if the frequency is not set, events are triggered via a file descriptor. +## Client Demo example + +Here is an example to show how to get data from iiodevices with the demo client. + +### Launch afb-client-demo + +First, launch the client demo with right port and right TOKEN, the example below +matches with ff(6.x) AGL version. + +``` bash +afb-client-demo ws://localhost:1055/api?token=HELLO +``` + +### Subscribe to acceleration + +Here is a list of different examples to subscribe to acceleration data. + +#### Subscribe to acceleration with x,y and z axis with a frequency of 0.1 Hz + +``` bash +iiodevices subscribe { "event": "acceleration", "args": "xyz", "frequency": "0.1" } +``` + +#### Subscribe to acceleration with x and z axis + +``` bash +iiodevices subscribe { "event": "acceleration", "args": "xz" } +``` + +Events will be sent each time a new value is available (sent by iiodevice). + +### Unsubscribe to acceleration + +``` bash +iiodevices unsubscribe { "event": "acceleration" } +``` + ## Remaining issues -- Provide a json config file so that it configures the device name and the channel name. +- Provide a json file to configure the device name and the channel name. - Handle several values simultaneously, see triggers. -- Update it to other iiodevices. -- only read channel values at the maximum frequency. +- Update this binding for other iiodevices. +- Only read channel values at the maximum frequency. +- Change args values into json arrays. ## M3ULCB Kingfisher -- cgit 1.2.3-korg