Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: Iba7c564eea48495c76de8ca919725a2e4b332fd6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I617f758890c3508f55d568b0e5c57c8c5d4d5dd1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Pass the plugin to action using source structure. Plugin pointer is now
accessible from anywhere in the plugin callbacks.
Clean deprecated function.
Change-Id: Idf50728af0b3573a45c4731d4343cf67741b662c
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
AFB returns a missing API as a warning and doesn't abort
the process. It is a binding duty to know if it should exit
or not. Here a missing API is considerate as an error and abort
the binder.
Change-Id: Id11bcc34fd5fa8fd8a9a5cbd70d6d3340190dc1d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Correct an error when 'PluginConfig' function is called while
no plugins are defined in passed json.
Change-Id: I281a18f601f8ca1b7dfedfe48d1de37f4e9eded4
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Decrease print level when 'OnloadConfig' function is called while
no onload action are defined in passed json.
Change-Id: I173cb9b6824f7f32cf33a6755ed52f9dcf093ee6
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Add a 'params' fields for controller plugins.
Can be used to send specific parameters
to plugins functions (onload, init, ...).
Change-Id: Ifb16f06a20453ef2bd1bc8a72bc2841dc12e323c
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Call wasn't done correctly in 'CtlConfigExec', some functions
were not call by 'CtlConfigExec' when it should be ...
Change-Id: I5ce44e616042868c349bd5637c56267b8eff72e1
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
This lets you add new actions to a section from a plugin,
typically at its init step.
Change-Id: I33a61c6162d25332d680d8a0e2d1841a457e0e80
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
The onload step could be considered as a preinit step. Init stage
happens once all plugins are loaded and so you can refer to them
to add new actions or configuration elements.
Change-Id: I7986265bb1227208d0648bb2c56a1172b164faf1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
This changes the default behavior when loading actions. Now, it appends
the new actions to the old ones instead of replacing them when called
several times.
If there were no actions previously loaded then it just loads normally
the actions.
Change-Id: Ica58a3edf4a9bf18ae31c6b6a5fa329e7ec5478b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
binder FF.RC4 provides the missing define afb_service_call[_sync]_legacy
which doesn't fit with define in the controller as the first argument
API is already given by the app framework binder.
Change-Id: Ia2d01b172386d96354d356e66817b166985fa646
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Variable is already defined earlier with all function scope.
Redefining here make the variable value wrong at the ending
return statement.
Change-Id: I85269d1f60a7e1b844d19dd902149fa25da50844
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
fixed a malloc random crash when loading the configuration files.
A write of one byte was done outside of an allocated area.
Namely, strncat always writes n+1 bytes, thus a best practice is to always
calculate n as this:
buffer_size-strlen(s)-1
Change-Id: Icb568f324d466fc6eef40c3e251ce6b8a7006d95
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
|
|
This makes controller fully compatible with binding v3 and
also keeps the compatibility with the Pre-V3 + DYNAPI bindings.
Change-Id: Iaa47e51b9cb964bbe2f050784fca355c780673f8
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Adds v3 function to get binding settings waiting the real
migration of the controller to v3
Change-Id: Iece3fcbcb81de807927765097c964e3272165947
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: If4d8416c87c668ebc55d3866ccd038c652317b43
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change the default GLOB pattern because the lua should be found in
var directory by default.
Change-Id: I8be0e85c97459553e1d6a9f58efa394eb311a514
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I020a1619c94a3a22d66e6657f64d4cedda3a1e62
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
This resolves the link to the binding library then set
the directory path to the widget installation location.
Change-Id: Iaad0d8aad6e3b8bfdcdedde19fb7906adf5f9610
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Add a function that returns the size of a table as the
operator '#' isn't considered are safe or accurate.
Add another function to deep copy a table.
Change-Id: Ia549315e305dd7d02b975a3e8a1278c4ab709eec
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
This will indicates what is the error at the LUA file loading
Change-Id: I258bf43a2200577998e05cf7b2253bdd510a468e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Old function had not the third argument.
Change-Id: Ifdcf341c0339aff80f9a6741f63ae0e7f8fae682
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
This make possible to load from a binding either a file
or directly a JSON object.
Change-Id: If3f3edb8aaed066922982250dd162d483a7dc47a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
There was a leack after poping arguments from Lua interpreter.
Now when a Lua2C function is called, if there is something to keep
from the argument then you should call json_object_get() on it
to preserve it.
Change-Id: I43e79ed73a507ac2ca7ed4cdc3f16ec009392194
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Wrong function signature.
Change-Id: I20794a0ae59fc54c08f0960544185e7ba42b2627
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I16e2f87980229b08426060ec062615d2fa3c1494
Signed-off-by: 8000ff <clementmallejac@gmail.com>
|
|
Keep passed json object unmodified during action execution.
Before, the action arguments were added in the json passed
(so, the json was modified, even for its provider).
Now, if action arguments need to be added to the json to execute an
action, 'ActionExecOne' function clone the passed json object,
add action arguments into it, and use it to call the action.
Change-Id: If102cc943326c17aad52cfde735362a72ad35a9a
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Prefix is the most reliable variable to find files or
variables for a controller, so this lets you access it
wherever it is needed without using global hardcoded
variables.
This helps to search for controller's plugins in several
locations depending on environment variables and hardcoded
variables (CONTROL_PLUGIN_PATH, CONTROL_CONFIG_PATH).
This implies also a change a LUA interpreter loading step to
correctly set the package.path variables with the environment
variables, too.
Correct the missing 'extern' in function declarations.
Depends-On: Ic448ff017e6158bec05895d63688b8968b5c6434
Change-Id: I0ad19242612559d1f4b66b6f9af9e7032d4675a8
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Use binding version to set controller definitions.
It is cleaner to define binding version directly into repository cmake
than into a header like before this commit.
Change-Id: Ie0f2812c8ac980e69ff901fb6e347f47f284f21b
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
change LUA_FIST_ARG into LUA_FIRST_ARG
Change-Id: Ie084e78f68dd0a29c4dfc8387200be9af5180647
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
|
|
added LockWait to wait for incoming events, as soon as an event is
received, the wait is unlocked
You can indicate the timeout
Change-Id: If29ca754618edb5b9fdc32c1c40b47016c6fc88a
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
|
|
There was an issue because the assignement happens
after the onLoad call.
Change-Id: I97dc65ad2a14a6e72bb2f59bc443d9fc5779abee
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Test again if the section is present in the configuration
JSON object before executing the callback.
Change-Id: Ibad352e8443d5d33d7e727fc3b80c56a377c75d3
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
This should fix case where plugin doesn't have an onload
section but need to set the apihandle to be able to use it
later.
Change-Id: I07d4d38ce236732575d97a3c0a01cb03acad255a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Plugins normally lie in a dedicated section and loaded
once for all. With this function we are able to load a
plugin after the initial load.
Change-Id: Iebacdfce836767089f164ebe5cff72c7e45803be
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Separate the require api step from ConfigExec and if called from
anywhere but CtlConfigExec function, take care that not already
initialized or that the previous has failed, so this is a new
try.
Change-Id: Ic98ef09487f7f58c1b1cb6c417eba261a5a81b13
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Set package.path lua variable use the CONTROL_PLUGIN_PATH
as it could have to find external lua packages in those
directories.
Change-Id: Iebea763782cfc024c5fef1fdbefe8ed80dbc4dbb
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Also detect problems when loading the script and report
it.
Change-Id: Iba22dcd0bbc6d7c307b5b7f66a56688ef3147250
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: Id4c3e0eb9f770c78b38d8650e6a89577851984f9
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
|
|
Still print a notice message when pushing a null object because having
a null object in LUA may be problematic and it's always a good idea to
warn developer.
Also use json_object_to_json_string (safer than json_object_get_string
in case of object is not a string) to dump json object in notice/debug
messages.
Change-Id: Ia3c252f38cbeca872b8f8fab1589da85d71a51ec
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
|
|
Change-Id: I0a3a1db6dacf017ecea5b91dc35eb3ec2d86515d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Ib1b300e589b08d3172c5b6aeaa8ef33df2c4fc65
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Sleep function and a recursive table
equality function
Change-Id: I4cb3a0f0909674f03caeadeebd8da35f16391198
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
The recent correction of the misspelling of AFB_ReqSuccess wasn't done
in every file and results into a compilation error.
This is corrected now.
Change-Id: Ic378cbec105ab922d4195e6e525bf3a642895665
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Call to json_object_put seems no longer needed in LuaAfbSuccess.
Change-Id: I2ee850605633b953217b3ad52a4a11059e841be3
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
|
|
Change-Id: Idb3cb8ebe94cc1670e8757c6ff713ab7ef107a8b
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
|
|
Also change event message from notice to debug level.
Change-Id: I8dc891343ee7f744ea0e3c07455806eaf34c1d7e
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
|
|
This variable was meant to save the result of a function call,
and be used into an 'if' statment. So, the function call was put
directly into the 'if' statment.
Bug-AGL: SPEC-1405
Change-Id: Ia352f5bbf310eadd91a19d80b813dc9f6d054028
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
When an action is loaded in controller, parsing the json passed to
describe the action was sending back an error if an unknown field
was present.
Now, the parsing just ignore unknown fields.
Bug-AGL: SPEC-1405
Change-Id: If95144ad6190d5d2a45d731e82b28ab4caae7c32
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|