aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-18 15:20:13 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-18 17:40:02 +0100
commit1b3411359d6a0e53f12811436a5410104816da34 (patch)
tree0f00b876b61eea6ffc46ed6e4d0f20914c399e1d
parent7ecafda0fb26647381f45b45f5b7d1ed0d252165 (diff)
Update documentation
Change-Id: I82edfc5111805cf5e2affad1a6366d1144006fbf Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--book.json4
-rw-r--r--docs/README.md8
-rw-r--r--docs/SUMMARY.md9
-rw-r--r--docs/cover.jpgbin259959 -> 260017 bytes
-rw-r--r--docs/cover_small.jpgbin13366 -> 13363 bytes
-rw-r--r--docs/part-1/3-Plugins.md11
-rw-r--r--docs/part-1/4-SignalComposerAPI.md16
-rw-r--r--plugins/builtin.cpp3
8 files changed, 39 insertions, 12 deletions
diff --git a/book.json b/book.json
index f876da3..25ff697 100644
--- a/book.json
+++ b/book.json
@@ -1,12 +1,12 @@
{
"title": "Signal Composer high level service",
"subtitle": "Developer Documentation",
- "description": "Signal composer let you compose and expose signals issued low level service",
+ "description": "Signal composer let you compose and expose signals issued low level services",
"keywords": "AGL, Development, Iotbzh",
"author": "IoT.Bzh Team",
"website": "http://iot.bzh",
"published": "December 2017",
- "version": "4.99-EERC4",
+ "version": "4.99-EERC5",
"gitbook": "3.2.2",
"root": "docs",
diff --git a/docs/README.md b/docs/README.md
index 337a14c..5079519 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,7 +1,11 @@
# Introduction
-This template is also a documentation that explains how to setup and write
-your documentation with gitbook.
+You will find in this documentation a presentation about Signal Composer
+architecture. Signal Composer is an Application Framework binding meant to
+facilitate handling signaling, by compose, divide and create new virtuals
+signals from RAW signals coming from _low level_ binding that handle read/write,
+encode/decode on different protocols that a car could use (CAN, LIN, Ethernet,
+GPS, i2c, ...).
<br>
<br>
diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md
index 9d0f0a8..369ea6e 100644
--- a/docs/SUMMARY.md
+++ b/docs/SUMMARY.md
@@ -2,8 +2,7 @@
* [Document revisions](0-Doc-Revisions.md)
-* [Signal Composer](part-1/0_Abstract.md)
- * [Architecture](part-1/1-Architecture.md)
- * [Configuration](part-1/2-Configuration.md)
- * [Plugin](part-1/3-Plugins.md)
- * [Signal Composer API](part-1/4-SignalComposerAPI.md)
+* [Architecture](part-1/1-Architecture.md)
+* [Configuration](part-1/2-Configuration.md)
+* [Plugin](part-1/3-Plugins.md)
+* [Signal Composer API](part-1/4-SignalComposerAPI.md)
diff --git a/docs/cover.jpg b/docs/cover.jpg
index ea03df1..954e32c 100644
--- a/docs/cover.jpg
+++ b/docs/cover.jpg
Binary files differ
diff --git a/docs/cover_small.jpg b/docs/cover_small.jpg
index 5fcb1de..4278b7e 100644
--- a/docs/cover_small.jpg
+++ b/docs/cover_small.jpg
Binary files differ
diff --git a/docs/part-1/3-Plugins.md b/docs/part-1/3-Plugins.md
index cbc7284..50ece7b 100644
--- a/docs/part-1/3-Plugins.md
+++ b/docs/part-1/3-Plugins.md
@@ -1,6 +1,15 @@
# Plugins
-Plugins are C/C++ shared library that is loaded by the binding to execute some
+Plugins are C/C++ shared library loaded by the binding to execute some
simple routine. Routine could be on reception of a new signal or at sources
initialization time or signal subscription with the respective JSON field
**onReceived**, **init** and **getSignals**.
+
+A default plugin (builtin) is provided with 2 functions:
+
+- **defaultOnReceived**: set and record a new signal value and its timestamp
+ in the signal composer service. It simply tooks the incoming event JSON object
+ and search for *key* **value** and **timestamp** then call function
+ `setSignalValue`.
+- **setSignalValueWrap**: a **lua2c** function the could be called from any LUA
+ script to record a new signal value.
diff --git a/docs/part-1/4-SignalComposerAPI.md b/docs/part-1/4-SignalComposerAPI.md
index dc47f01..246b62f 100644
--- a/docs/part-1/4-SignalComposerAPI.md
+++ b/docs/part-1/4-SignalComposerAPI.md
@@ -19,6 +19,22 @@ ON-EVENT signal-composer/257b343e-8ea9-4cd7-8f9e-1904fa77f8f2({"event":"signal-c
Unsubscribe happens the same way. When no more signals are holded by the client
then it unsubscribe from the *AGL Application Framework* event handle.
+## addObjects
+
+Let you add sources or signals objects to the signal composer service after
+its initialization phase. Use this verb and specify the file as argument, you
+could use only the file name or the file name with its absolute path.
+
+```json
+signal-composer addObjects {"file": "sig_doors.json"}
+ON-REPLY 1:signal-composer/addObjects: {"jtype":"afb-reply","request":{"status":"success","uuid":"00d7a519-816e-486a-8163-3afb1face4fa"}}
+signal-composer addObjects {"file": "/tmp/sig_doors.json"}
+ON-REPLY 2:signal-composer/addObjects: {"jtype":"afb-reply","request":{"status":"success"}}
+```
+
+You can follow the activity using the service log journal and check that the
+correct number of objects has been added.
+
## get
You can get a signal value be requesting the API with the verb *get*:
diff --git a/plugins/builtin.cpp b/plugins/builtin.cpp
index 4f2d239..5eccc24 100644
--- a/plugins/builtin.cpp
+++ b/plugins/builtin.cpp
@@ -36,7 +36,6 @@ CTLP_CAPI (defaultOnReceived, source, argsJ, eventJ)
AFB_NOTICE("source: %s argj: %s, eventJ %s", source->uid,
json_object_to_json_string(argsJ),
json_object_to_json_string(eventJ));
- void* sig = ctx->aSignal;
json_object* valueJ = nullptr;
json_object* timestampJ = nullptr;
@@ -48,7 +47,7 @@ CTLP_CAPI (defaultOnReceived, source, argsJ, eventJ)
{timestamp = json_object_get_int64(timestampJ);}
struct signalValue v = value;
- ctx->setSignalValue(sig, timestamp, v);
+ ctx->setSignalValue(ctx->aSignal, timestamp, v);
return 0;
}