summaryrefslogtreecommitdiffstats
path: root/docs/part-1
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-05 15:36:17 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-05 16:22:47 +0200
commit3e45dda1b12578c9d84b7a4f479e2a9fbaaa5d3b (patch)
treeb9db87d4972299fd7ceff366d3c1ae6d88dc4a99 /docs/part-1
parent772552a441dae3ef7e25c7144269385c9ca68a4e (diff)
Change, clean plugins.
Improve GPS plugin to be able to calculate the heading also remove the builtin plugin that was an error. We need to pass GPS plugin in C++ to be able to use the context. Handle "double" and "int" signal's value. Change-Id: I6d902e4ac76a0e933326c0b4c43922645c9c5a4c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'docs/part-1')
-rw-r--r--docs/part-1/3-Plugins.md16
1 files changed, 12 insertions, 4 deletions
diff --git a/docs/part-1/3-Plugins.md b/docs/part-1/3-Plugins.md
index 50ece7b..b58bbad 100644
--- a/docs/part-1/3-Plugins.md
+++ b/docs/part-1/3-Plugins.md
@@ -1,15 +1,23 @@
# Plugins
-Plugins are C/C++ shared library loaded by the binding to execute some
+Plugins are C/C++ shared libraries 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**.
+`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
+ and search for *key* `value` and `timestamp` then call function
`setSignalValue`.
-- **setSignalValueWrap**: a **lua2c** function the could be called from any LUA
+- **setSignalValueWrap**: a `lua2c` function the could be called from any LUA
script to record a new signal value.
+
+> **CAUTION**: `timestamp` value has to be typed as *uint64_t* with
+> a **nanosecond** precision using a realtime clock. To correctly store it in
+> a JSON-C object use the int64 type with the according fonctions:
+> *json_object_new_int64()*
+> *json_object_get_int64()*
+> *json_object_set_int64()*
+> *...*