Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Use macro to test request validity before reponding to an api call.
This macro handles if request is a pointer or a structure (depending
if dynamic api are used).
Change-Id: I2cd6539e0fe0b6e0324e82fbeef62731d0323be9
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Reduced the number of warnings in native host configuration (here
Tumbleweed) in order to not hide true/real warnings that may appear
in the future.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
|
|
Don't create a new object each time a action is executed.
Correction in the way that args are added in the api query.
Correction to return the response of the api call if received.
Optimization of how get/put are done in 'ActionExecOne' function.
Change-Id: I30d0d6450599b7da7bfa9ad29b21d1be8ea6243e
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Replaced some 'size_t' by 'int'
Change-Id: Iaf58b4b65f9aa2e82c0a87af45f21ca62fa4d84e
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
|
|
This change ensure that there are no write over the
destination buffer size
Change-Id: Ic213e70fab83dfae39a8ff030c823a6ce68aab64
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Be able to detect that an action has failed on an
Onload section processing to avoid retrieving a wrong
context after that.
Change-Id: If694b11eb0a37154b539c421e43bebdb15d498c0
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
A JSON object coming from an AFB request is handled
by the appfw. So, it release it once request has been
executed. ActionExecOne also decrement the reference
count of the json_object, so to make the count right
it is needed to call a json_object_get here.
Change-Id: I4c74a767e8e51e8b975ebe66c97f5b1f5b3aba05
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Rather use tests with a test framework.
Change-Id: I1c626c7cc96403587a57ae23af67c95f6ed2f862
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I666136b1f1fb21d223fa16f299de2ce5430a0c7e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Because before uri could be a path it wasn't suits
for parsing as we can't have any character chosen as
separator. As now, first part isn't a path but rather
a plugin/resource uid then it fine since the separator
isn't allowed in the uid
So # is forbidden for uid by the schema.
Change-Id: Ida3d7acb46687188c44a472c057c58301cb1d9c6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: Ibb7dbc32580100c588d06e283abb57cc37875312
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: Ied901f39cd6814e5afd9811248b0a1fb401f3e76
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
For convenience queryJ will always be released. Users has to
call json_object_get to be able to use it after that.
API subcall use an intermediate variable to avoid modifying this
parameter in case of user wanna use it after that.
Change-Id: I98f478d3fc0c4ef28234811333b9effd8289e74d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Split and cleaner function that load from JSON object
an object CtlActionT that could be used by the controller.
Also use a new syntax that reduce the number of JSON fields
to parse based on a URI syntax.
Change-Id: Iabc447368ca56e3a4279fb728ba2f546e11c961b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change the way to load LUA scripts. They are now considerate
as Plugin and loads with them.
This imply rework of how to search and find plugins as
well as the way to load LUA.
Also load an harcoded LUA scripts providing LUA helpers
and managing global variables lock unlock mechanism
Change-Id: I64e38aa27278d0cfdca787155db2d0c89953f905
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Instead of only have API subcall releasing the json_object
now release in all cases to be coherent.
This should be argument to be passed to an action, treated
in that action then after that has been done, this object
has no more meanings and should be released.
Change-Id: I371f0c3db34f4126a812d70b7e3ccb9f8bb5f776
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I8cde66dc613fd36e7061f45918520ecd1cdf2825
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Previously using parameter and modifying it which could involves
side effects. Better to use an intermediary json_object
to be fills with action->argsJ and queryJ object meld
together.
Also fix segfault after json_object_put called inside
AFB_ServiceSync doing a json_object_get() on object
to be conserved
Change-Id: I4618a7bc87e111afa1fe047168ba7232241ac4c8
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Mark "ldpath" parameter as optional like it is.
Change-Id: If32e078f5a4349ab895b1fd4b8f0a8c542d247a1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I8425f0de60a35b4e287c8829fe72cbca80bc55df
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: Ida18aeab20d5b894609c1a9c2f6fc2a71a0b4a23
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: Id485aa5ddf8d78a1fc48922cb3c3161fb65dea1b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I7a8a3ac4846f1190caf1a4dde066e50dc592d58b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Format JSON unpack operations
Change-Id: Iaed0988d8536ad1df60a32a610e69e35485fc9f8
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I2b805a60b67db1a72b429093256999673e2c3964
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: Ic8f1d418db228ca8c646263b32a2431931a6a4be
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
|
|
|
|
|