Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
Update README accordingly to new metadata keys.
These keys was added in the commit :
'Handle more metadata in the controller'.
Change-Id: Icdee5bdf4a6cf0d8b8bd5dde4adc3bbf04653a50
Signed-off-by: Jonathan Aillet <jonathan.aillet@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>
|
|
README.md synchronizes from deprecated repo https://github.com/iotbzh/afb-controller.
Remove all audio stuff, update new config, running, satisfy new json
scheme from http://iot.bzh/download/public/schema/json/ctl-schema.json.
Change-Id: I77d858026aaf4a907018b1754b918c0fd141be31
Signed-off-by: Clément Bénier <clement.benier@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>
|
|
Use an external file for application framework include, for macro, and
for typedef definitions used by the controller.
In this way, it will be possible to include this file without getting
all the specific controller definitions.
Also define the correct version needed by the application framework
for dynamic api.
Change-Id: Ifaa09538f49ff2739eeb6a75527767961a2ef3b0
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>
|
|
Increase lua script max message size to avoid app-controller
warning messages when a lua print message is too long with
4a-softmixer.
Change-Id: I3c2496ea3e5bd971b7682328f7a6227e36b6d706
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
Prevent lost of config file path when searching by keeping only
the first file found.
Add a warning if multiple files are found.
Change-Id: I97262c4dbbc53bb921ef25b9100491cf3e29a056
Signed-off-by: Jonathan Aillet <jonathan.aillet@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>
|
|
Add fields that will be searched for during controller metadata
section parsing.
These fields are optional, so they will be copied in CtlConfigT
if they are present. Otherwise, no error will be raised.
The added fields are :
- 'author' which should contain the author name
of the configuration file.
- 'date' which should contain the date of the configuration file
last modification.
Change-Id: Iab480533d85c4a52ea5f6a70fb6f9b8d0b866af4
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
When prefix is set to NULL, only the middle name of the process
will be used to find configuration files.
Example: when the binder is named 'afb-4a-hal', and the prefix
parameter is set to NULL, the 'CtlConfigScan' function will search
for 4a-*.json config files in 'dirList' list.
Change-Id: I8a9ee7df670d992f5461c865591ced9ba46fe8a0
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>
|
|
Add an external field to CtlConfigT to store
external data (by casting to void *).
Change-Id: I368319f4cde6dc0409b5672809cc19a08e43dd67
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
|
|
It is already mandatory from a JSON schema point of view
so here it should be the same. Also it simplifies the process
avoiding the guess and deduction...
Change-Id: I3197b4c7798589f4c62814407909270cdabd1dae
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
If no prefix given, then only use the binder name
to search config file.
Change-Id: I504ea27dccb8892e12e09d3e9e42bc281bcf87b0
Signed-off-by: Romain Forlot <romain.forlot@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>
|
|
Change-Id: I4ee750f4d95e9fe47352e6cd1dfaeaa94c292e30
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>
|
|
Don't calls two times the same function.
As well as avoiding using the function return to
get its length
Change-Id: I26c37f9a376b2c243ffd7a5ad0ddf935c8b5d0e9
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>
|
|
This adds a macro to be able to retrieve the rootdir fd
from the binding using V2 or DynAPI version the same way.
Change-Id: I4e9e805b729118944f07ccedae6cccc6b950058b
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>
|
|
Clearer JSON writing config. Schema provide informations
about objects
Change-Id: I55e7c9bef442abaa577c59ab2005da1f315f9312
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Don't use a static and fixed index to reach event
section. Rather browse sections array to find it
Change-Id: I4eed8abf73f674034da252aa9d133325f82e62c2
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
We could have several file
Change-Id: Ia612cb6989a05cc47505ec8975ae825be160af2a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: I666136b1f1fb21d223fa16f299de2ce5430a0c7e
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Signature was wrong since last modification about
controller and lua integration that now transport
source informations.
Change-Id: I8f98415b55978e6b7221415ad6169e8d2bc1c959
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>
|
|
That follow the last update in afb-helpers submodule
used.
Change-Id: Ia6149ae96c1591f3d0791f4263e8beafbe6e764d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
Change-Id: Ied901f39cd6814e5afd9811248b0a1fb401f3e76
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|
|
* changes:
Loads l2c functions per plugin.
Improve json object release
Improve way to loading an action
|
|
L2C functions are prefixed with either the chosen
prefix or plugin uid by default.
Change-Id: Id296ec629c803ab06cd05f5278fed3c48cbcf10e
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>
|
|
Test the wrong pointer to know if there is a CB to execute. Action pointer
could be void as the loading callback isn't stored in it.
Change-Id: I3281cdd603cc8b90059331fcff694b354eae1db0
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
|