Simplified doc-site generation
[AGL/documentation.git] / docs / 4_APIs_and_Services / 4.5_Message_Signaling / 4_AGL_Service_Signal_Composer / 3_Plugins.md
1 ---
2 edit_link: ''
3 title: Plugins
4 origin_url: >-
5   https://git.automotivelinux.org/apps/agl-service-signal-composer/plain/docs/part-1/3-Plugins.md?h=master
6 ---
7
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/agl-service-signal-composer-developer-guides-api-services-book.yml -->
9
10 # Plugins
11
12 Plugins are C/C++ shared libraries loaded by the binding to execute some
13 simple routine. Routine could be on reception of a new signal or at sources
14 initialization time or signal subscription with the respective JSON field
15 `onReceived` `init` and `getSignals`
16
17 A default plugin (builtin) is provided with 2 functions:
18
19 - **defaultOnReceived**: set and record a new signal value and its timestamp
20  in the signal composer service. It simply tooks the incoming event JSON object
21  and search for *key* `value` and `timestamp` then call function
22  `setSignalValue`.
23 - **setSignalValueWrap**: a `lua2c` function the could be called from any LUA
24  script to record a new signal value.
25
26 > **CAUTION**: `timestamp` value has to be typed as *uint64_t* with
27 > a **nanosecond** precision using a realtime clock. To correctly store it in
28 > a JSON-C object use the int64 type with the according fonctions:
29 > *json_object_new_int64()*
30 > *json_object_get_int64()*
31 > *json_object_set_int64()*
32 > *...*