summaryrefslogtreecommitdiffstats
path: root/docs/part-1/4-SignalComposerAPI.md
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-11 18:53:20 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:49 +0100
commit66f40a59436c09c6da3042659d96e4dfbf0f4526 (patch)
tree0ff8391a52bb9f84d3ebf1347c844107cac98b5f /docs/part-1/4-SignalComposerAPI.md
parent0524ef772bf0a06fec736d7e1bd0753a7b65bc8c (diff)
Update documentation
Change-Id: Ie7c6fc98b450e0f856378b615ded2a586f02a7ad Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'docs/part-1/4-SignalComposerAPI.md')
-rw-r--r--docs/part-1/4-SignalComposerAPI.md21
1 files changed, 20 insertions, 1 deletions
diff --git a/docs/part-1/4-SignalComposerAPI.md b/docs/part-1/4-SignalComposerAPI.md
index 00dbae4..dc47f01 100644
--- a/docs/part-1/4-SignalComposerAPI.md
+++ b/docs/part-1/4-SignalComposerAPI.md
@@ -1,5 +1,24 @@
# Signal Composer API
+## subscribe/unsubscribe
+
+Using subscribe you can get update on change for signals you chose and you can
+using wildcard to subscribe several signals in the same time.
+
+```json
+signal-composer subscribe {"signal": "rear_left*"}
+ON-REPLY 1:signal-composer/subscribe: {"jtype":"afb-reply","request":{"status":"success","uuid":"3d4b743b-7ac6-4d3c-8fce-721107f9dee5"}}
+```
+
+Then event comes up like the following:
+
+```json
+ON-EVENT signal-composer/257b343e-8ea9-4cd7-8f9e-1904fa77f8f2({"event":"signal-composer\/257b343e-8ea9-4cd7-8f9e-1904fa77f8f2","data":{"uid":"rear_left_door","event":"low-can\/messages.doors.rear_left.open","timestamp":4833910845032292484,"value":false},"jtype":"afb-event"})
+```
+
+Unsubscribe happens the same way. When no more signals are holded by the client
+then it unsubscribe from the *AGL Application Framework* event handle.
+
## get
You can get a signal value be requesting the API with the verb *get*:
@@ -29,5 +48,5 @@ Verb **loadConf** let you add new files to be able to add new **sources** or
**signals**.
```json
-signal-composer loadConf {"filepath": "/path/to/your/json/file.json"}
+signal-composer loadConf {"file": "/path/to/your/json/file.json"}
```