src/app-framework-binder.git
5 years agoafb-socket: Improvement 41/16241/1
Jose Bollo [Mon, 20 Aug 2018 14:09:40 +0000 (16:09 +0200)]
afb-socket: Improvement

Allows to either open a 'struct fdev*' or a int.
This prepares further integration in afb-api-ws.

Bug-AGL: SPEC-1668

Change-Id: I3d61be582bceaab636460b3c7de3ac2f24ed9473
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-stub-ws: Improve naming 39/16239/1
Jose Bollo [Mon, 20 Aug 2018 13:15:39 +0000 (15:15 +0200)]
afb-stub-ws: Improve naming

The function afb_stub_ws_on_hangup is now
named afb_stub_ws_set_on_hangup.

Bug-AGL: SPEC-1668

Change-Id: Ie96c77d4af10ee6b42aea6f57d7c3aadb95e6467
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agohello3: Add mutebug 37/16237/1
Jose Bollo [Mon, 20 Aug 2018 13:06:56 +0000 (15:06 +0200)]
hello3: Add mutebug

The verb mutebug returns without answering
but increment the reference count of the request.

This has 2 weird effects:
 - on the service, it creates a memory leak
 - on the client, it creates a starve of answer

Both effects are intended to test further improvements
of the binder.

Change-Id: I76ebe0dff1b42a8a72e1b3536857d1d1811452c1
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoSet version to 5.99.FFRC4 29/16229/1
José Bollo [Wed, 22 Aug 2018 12:03:25 +0000 (14:03 +0200)]
Set version to 5.99.FFRC4

Change-Id: I8404d2cc83624eae755c39175e3096e024f30e24
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoProvide functions afb_service_call[_sync]_legacy 61/16161/1
Jose Bollo [Mon, 20 Aug 2018 12:44:31 +0000 (14:44 +0200)]
Provide functions afb_service_call[_sync]_legacy

These functions was missing and the documentation
was erronous. This fixes that issue by providing
the missing functions and updating the documentation.

Bug-AGL: SPEC-1669

Change-Id: I543b0fbe29370be6f35f15ca3bfa48fef9ab4055
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-export: Provide the real path of the binding 05/16005/2 5.99.3 flounder/5.99.3 flounder_5.99.3
José Bollo [Fri, 3 Aug 2018 11:00:35 +0000 (13:00 +0200)]
afb-export: Provide the real path of the binding

The path can be a symbolic link. It must be resolved
to be usefull.

Change-Id: I5db247fd9925065684e036d8d458c2131006f9db
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix warnings and false errors 67/15967/1
José Bollo [Thu, 2 Aug 2018 17:43:48 +0000 (19:43 +0200)]
Fix warnings and false errors

Change-Id: I434a0bd6be2758fd7964bc272d63dc280d400f47
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-export: Manage path of libraries 63/15963/1
José Bollo [Thu, 2 Aug 2018 13:26:59 +0000 (15:26 +0200)]
afb-export: Manage path of libraries

This change allows a binding to know its
installation path. This path is retrieved using
the api function 'afb_api_settings'.
The path is returned --if known-- as a string
of key "binding-path".

Change-Id: Ie1a349dc4936d4ccf173f1f77e118099f7f0599a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoAdd ability to provide binding settings 61/15961/1
José Bollo [Fri, 27 Jul 2018 15:38:22 +0000 (17:38 +0200)]
Add ability to provide binding settings

Change-Id: Iab93a26340fa9743a58ca43cd903bbf31c783e5b
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoImprove parsing of json string 59/15959/1
Jose Bollo [Wed, 1 Aug 2018 11:44:23 +0000 (13:44 +0200)]
Improve parsing of json string

Change-Id: I7100961ef8f8a75d623a0667178f191dd4cfb9d3
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-socket: Separate socket creation 57/15957/1
José Bollo [Tue, 31 Jul 2018 17:02:18 +0000 (19:02 +0200)]
afb-socket: Separate socket creation

The objective is to have a well identified and
possibly reusable internally.

Change-Id: Icdb6ce7d85ae26373cfe4f0b492fe97b74ed747c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agotic-tac-toe: improve event handling 55/15955/1
Jose Bollo [Wed, 1 Aug 2018 08:24:53 +0000 (10:24 +0200)]
tic-tac-toe: improve event handling

Change-Id: Ifba67b4b83650f9b32f78d077d0bbd3d3882238b
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-msg-json: remove obsolete function 53/15953/1
Jose Bollo [Mon, 30 Jul 2018 15:43:14 +0000 (17:43 +0200)]
afb-msg-json: remove obsolete function

The function afb_msg_json_internal_error was based
on the previous reply standard and was not
used very much. Removing it seems a good idea.

Change-Id: I3dddee9c24ffd8c43c787b9b6a737ab013d757b7
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafs-supervisor: Improve comments 51/15951/1
José Bollo [Tue, 31 Jul 2018 15:51:19 +0000 (17:51 +0200)]
afs-supervisor: Improve comments

Change-Id: Ic1954403e3924def8fc9fa395ac54e4c5ee6293a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Improve coverage test 13/15813/1
José Bollo [Tue, 24 Jul 2018 10:53:15 +0000 (12:53 +0200)]
coverage: Improve coverage test

The test now raise an overall coverage rate:

  lines......: 75.4% (8356 of 11080 lines)
  functions..: 80.4% (1094 of 1360 functions)

Also Improve the documentation and improve parts of code.

Change-Id: Ic2b8bc2f85d4181aa0b358a953f95cb105a0eed9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-export: Set API context as validated 07/15807/1
José Bollo [Fri, 27 Jul 2018 12:40:19 +0000 (14:40 +0200)]
afb-export: Set API context as validated

An API is always valid internally to the binder.

Change-Id: I3c8eed166c9cfc1bcc47daa30c8f327af777d136
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agomain-afb-client-demo: Exit with a significant code 83/15783/2
José Bollo [Thu, 26 Jul 2018 13:55:09 +0000 (15:55 +0200)]
main-afb-client-demo: Exit with a significant code

The program afb-client-demo now exits whith one of the
following code:

 0 - everything went well, no error
 1 - last received answer was an error
 2 - the remote hung up the connection
 3 - stdin either has too long line (16384) or has error
 4 - bad argument of the command line
 5 - cant connect to remote

Bug-AGL: SPEC-1619

Change-Id: Ia979c9ddcdae496ce205882b895cd9742f93f365
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoTune dependency to fdev-epoll 53/15753/1
Jose Bollo [Wed, 25 Jul 2018 14:48:42 +0000 (16:48 +0200)]
Tune dependency to fdev-epoll

The dependency to fdev-epoll is not real
at the moment because afb-daemon still uses
systemd event loop mechanisms. At the end
use of it will depend on the conditional
compilation flag as REMOVE_SYSTEMD_EVENT here.

Change-Id: I46e65cddafef05a9418cd4cf4d5cbf596ebeda49
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-v3: Simplify the code 41/15741/1
Jose Bollo [Wed, 25 Jul 2018 13:05:08 +0000 (15:05 +0200)]
afb-api-v3: Simplify the code

Having a code more easy to read is better here.

Change-Id: I429e82d87729e41ec53d0852daa6f146261443c9
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agofdev: Simplify the code 39/15739/1
José Bollo [Tue, 24 Jul 2018 14:50:00 +0000 (16:50 +0200)]
fdev: Simplify the code

Less code is faster and safer.

Change-Id: Ide71fec5ee80f14482e2972a3d0f65ef0b589f12
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Add inet's API test case 37/15737/1
José Bollo [Tue, 24 Jul 2018 12:44:25 +0000 (14:44 +0200)]
coverage: Add inet's API test case

Change-Id: I2a08d70b655478252de48fa2071cd4682aa4192d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix some more memory leaks 35/15735/1
Jose Bollo [Wed, 25 Jul 2018 12:13:36 +0000 (14:13 +0200)]
Fix some more memory leaks

While making coverage test, few leaks appeared.
This corrects the last discorvered ones.

Change-Id: Id9e508bc9412072b628742971b02dd3d62799f3f
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-config: Rewrite the config as JSON object 33/15733/1
José Bollo [Fri, 20 Jul 2018 15:57:59 +0000 (17:57 +0200)]
afb-config: Rewrite the config as JSON object

Despite its poor performance, this changes is good
at the end because:

 - it allows to put config in files
 - it removes dirty code to translate to JSON
 - it removes dirty code to dump the config
 - it unifies code for scanning hook's flag's names
 - it improves unity of naming between option's names and JSON's names

Change-Id: I2487c8746d78a0cff80505a12b9fa60e40da9951
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix tiny documentation bug 31/15731/1
Jose Bollo [Wed, 25 Jul 2018 13:09:07 +0000 (15:09 +0200)]
Fix tiny documentation bug

Change-Id: Ib11160a8137480af92c450b65039b1272084f2d6
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agomain-afb-daemon: Reorder instantiation of API 63/15663/1
José Bollo [Tue, 24 Jul 2018 12:45:11 +0000 (14:45 +0200)]
main-afb-daemon: Reorder instantiation of API

The client API are now instanciated after the server API.
This allows to be client of itself but forbids to export
(serve) a client API.

Change-Id: I9b19180cfb60108344c2f846427e964df8339430
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojson-c: Remove escaping of slashs 61/15661/1
José Bollo [Tue, 24 Jul 2018 09:47:44 +0000 (11:47 +0200)]
json-c: Remove escaping of slashs

By default json-c escapes the slashes. This is almost ugly
and unuseful. But the resolution (with JSON_C_TO_STRING_NOSLASHESCAPE)
was introduced lately by json-c. Integrate it as much as possible.

Change-Id: Ia9c4bee78dc11df1ee9640cb04311991bd860e43
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agocoverage and test: Add tests 59/15659/1
Jose Bollo [Thu, 12 Jul 2018 08:59:48 +0000 (10:59 +0200)]
coverage and test: Add tests

coverage values:
  - lines:     70.5 %
  - functions: 76.3 %

Change-Id: Iaf802e84bbfa57502bbbac8c3b567b14c01608b6
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-api: Define the function afb_api_is_public 57/15657/1
José Bollo [Tue, 24 Jul 2018 08:00:17 +0000 (10:00 +0200)]
afb-api: Define the function afb_api_is_public

And remove the info line setting that the API .
is added.

Change-Id: I42e247036b9a1016797bb2674ad95f8a8c30e9be
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoTiny documentation fixes 55/15655/1
José Bollo [Tue, 24 Jul 2018 09:53:44 +0000 (11:53 +0200)]
Tiny documentation fixes

Some english improvement of the documentation.

Change-Id: I066c41d657a1921ed7dcc46dafcc7c65d122239c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-export: Fix event handler of API 53/15653/1
José Bollo [Tue, 24 Jul 2018 13:27:13 +0000 (15:27 +0200)]
afb-export: Fix event handler of API

Change-Id: Ibadaf6f41e39cce398d33a2a2a73751d68dad34d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-config: Simplify version print 97/15497/1 5.99.2 flounder/5.99.2 flounder_5.99.2
José Bollo [Thu, 19 Jul 2018 17:19:13 +0000 (19:19 +0200)]
afb-config: Simplify version print

Change-Id: Ia9fc00fbb04a27a46dd66cb60e9b359645f9dc11
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-trace: Fix bug on uuid of session's events 93/15493/1
José Bollo [Thu, 19 Jul 2018 16:28:07 +0000 (18:28 +0200)]
afb-trace: Fix bug on uuid of session's events

Change-Id: I4e4c2f337ae61a3399c7c97cfd028411f1471f98
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-trace: Fix bug in session handling 75/15475/1
José Bollo [Thu, 19 Jul 2018 14:36:25 +0000 (16:36 +0200)]
afb-trace: Fix bug in session handling

A copy-paste error!

Change-Id: Iaf7bd9f3cbd62cddfbab04fecc685f334f983175
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix errors in migration to V3 65/15465/2
José Bollo [Thu, 19 Jul 2018 12:09:17 +0000 (14:09 +0200)]
Fix errors in migration to V3

Fix a tiny error in the migration script and improve it.

Fix declaration of afb_daemon_get... without args for
binding V3 compatibility.

Fix declaration of afb_api_event_handler_...

Fix the correct URL to the sed script:
 valid:   https://git.automotivelinux.org/src/app-framework-binder/plain/docs/migration-to-binding-v3.sed
 invalid: https://git.automotivelinux.org/src/app-framework-binder/tree/docs/migration-to-binding-v3.sed

Bug-AGL: SPEC-1595

Change-Id: I245b20a9c14634a94c69420312afbd97628bc750
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoSet version to 5.99.FFRC3 25/15425/1
José Bollo [Tue, 17 Jul 2018 09:27:45 +0000 (11:27 +0200)]
Set version to 5.99.FFRC3

Change-Id: Ia735f23a473849d130992c32c312213533311736
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-binding: Add missing declarations 95/15395/3
José Bollo [Fri, 13 Jul 2018 17:13:52 +0000 (19:13 +0200)]
afb-binding: Add missing declarations

The functions afb_api_set_verbs_v3 and afb_api_delete_api
were missing.

Change-Id: Icab928984dd6620b8b3920d0406aeb3cb35c9428
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoSimplify starting of services 87/15387/2
José Bollo [Fri, 13 Jul 2018 14:38:55 +0000 (16:38 +0200)]
Simplify starting of services

The previous version was confusing and was expecting
that onneed and share_session were always true.

Removing this parameter simplifies the code.

Also handle errors of required classes and apis at initialisation.

Change-Id: I7c99aa356cba41f368bd47cab797fa086a5740af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-trace: Fix compiling error on old json-c 85/15385/1
José Bollo [Fri, 13 Jul 2018 13:46:01 +0000 (15:46 +0200)]
afb-trace: Fix compiling error on old json-c

Versions of json-c older than 0.12 doesn't have
the function json_object_new_double_s.

Change-Id: If34c36ddcfabb3796aeb6739cd150e2b3e763679
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hook & afb-trace: Fix usage of readlink 75/15375/2
José Bollo [Fri, 13 Jul 2018 12:33:56 +0000 (14:33 +0200)]
afb-hook & afb-trace: Fix usage of readlink

The function readlink doesn't add a terminating null.
This patch fixes that were needed.

Change-Id: Ie15309471fe8203c8e98b97315c4ea30de3ccd75
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-binding: Fix export of "class" handling 73/15373/2
José Bollo [Fri, 13 Jul 2018 12:30:55 +0000 (14:30 +0200)]
afb-binding: Fix export of "class" handling

The functions afb_api_require_class and afb_api_provide_class
weren't exported. This commit fix that oversight.

Change-Id: Ica6532bd9e06aa9003a24ae7a54b05c64be7093b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-wsj1: Fix json parsing of unterminated 67/15367/2
José Bollo [Fri, 13 Jul 2018 09:13:29 +0000 (11:13 +0200)]
afb-wsj1: Fix json parsing of unterminated

When receiving 'false', 'true' or 1, the tokener isn't able
to terminate its job without ambiguity. Catch this case
to force a terminating character.

Change-Id: I5c78f759852060ccf0fac87b3f6fc33a65bf30c9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-v3: Fix wrong error message 55/15355/3
José Bollo [Thu, 12 Jul 2018 17:34:51 +0000 (19:34 +0200)]
afb-api-v3: Fix wrong error message

Change-Id: Idc2d85ccf71fb7c88a3bbcf981c316b5ba70f434
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-apiset: Try to initialize all APIs 53/15353/3
José Bollo [Thu, 12 Jul 2018 15:22:37 +0000 (17:22 +0200)]
afb-apiset: Try to initialize all APIs

Don't stop on the first error when initializing apis.
Record the error and return it at the end.

Change-Id: I1f0f50ff4e527ca5bf0e78904fccddafe54ba5f2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-export: Monitor calls to API initialisation 51/15351/2
José Bollo [Thu, 12 Jul 2018 15:17:16 +0000 (17:17 +0200)]
afb-export: Monitor calls to API initialisation

Catching SEGV or other exceptional execution error
is better for the whole process.

Change-Id: I0ece72abe5e0a7ebd7d29aafa416462e6e5963af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-so-v2: Monitor the preinit to catch SEGV 49/15349/2
José Bollo [Thu, 12 Jul 2018 15:15:56 +0000 (17:15 +0200)]
afb-api-so-v2: Monitor the preinit to catch SEGV

Add monitoring of preinitialisation of bindings v2
in the hope to better handle arbitrary code execution.

Change-Id: I86354caedb17ef9d4904c1f4f47b1ea3c6dd4c40
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agomain-afb-daemon: Kill child instead of it 47/15347/2
José Bollo [Thu, 12 Jul 2018 15:14:00 +0000 (17:14 +0200)]
main-afb-daemon: Kill child instead of it

Killing afb-daemon when exit is called has bad side effects.
Because there is no need to do it now, remove it.

Change-Id: I18903bb168b1722a522cb4a78c5c8c2508483996
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-config: Fix wrong error message and more info 45/15345/2
José Bollo [Thu, 12 Jul 2018 12:21:50 +0000 (14:21 +0200)]
afb-config: Fix wrong error message and more info

The wrong value of the log option wasn't displayed.

The output of --version now prints more compile options.

Change-Id: I09b8b66279a10cd4b2b6d460b3dbaeb370b3dadd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-supervision: Remove dependency to external 43/15343/2
José Bollo [Thu, 12 Jul 2018 09:22:14 +0000 (11:22 +0200)]
afb-supervision: Remove dependency to external

Also some cleaning in use of extern to allow
accurate grep.

Removing extern is better for linking and for
structuration.

Change-Id: I8121c4b9b34fa2737bffd2ecbe170d04d1d60ad1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoPackaging: Fix RPM build 27/15327/3
Romain Forlot [Thu, 12 Jul 2018 08:19:58 +0000 (10:19 +0200)]
Packaging: Fix RPM build

RPM build failed because there is an unpackaged files
found which has been installed. This fix the build error:

Installed (but unpackaged) file(s) found:
 /opt/AGL/lib64/afb/hello2.so

Change-Id: Id5775966bbc4cac00d6adc8b9032d32cf41a7207
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
5 years agomain-afb-daemon: Remove call to "nice" 45/15145/1
José Bollo [Mon, 9 Jul 2018 16:30:53 +0000 (18:30 +0200)]
main-afb-daemon: Remove call to "nice"

Instead of setting the priority in the binder, delegate
that responsibility of setting the priority of the process
to the launcher.

Bug-AGL: SPEC-1578

Change-Id: Ia6bdbdda72ce76fabc19c6448deeb62e2861dce0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agodocs: Fix internal links by referencing html files 25/15125/2
José Bollo [Mon, 9 Jul 2018 08:50:05 +0000 (10:50 +0200)]
docs: Fix internal links by referencing html files

What to reference? Markdown files or HTML files?
I dont like this solution but it is the least effort.

Bug-AGL: SPEC-1544

Change-Id: I0d2e2c7fe1cfe769149bee3af611b04d2fe1aead
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Improve testing 11/15111/2
Jose Bollo [Fri, 6 Jul 2018 15:07:19 +0000 (17:07 +0200)]
coverage: Improve testing

- Add test of bindings v2
- Distinguish between clean and cleanall
- More valgrind ouput

Change-Id: If929756d9d35ddb959b46f7330cbf318301d532e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agohello2: Add a binding v2 example 09/15109/2
José Bollo [Sun, 8 Jul 2018 17:00:51 +0000 (19:00 +0200)]
hello2: Add a binding v2 example

Needed for test of bindings v2.

Change-Id: I33f8b497428bf03f8f80ad26bcdec773d269f41d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agohello3: Fix a bug 07/15107/2
José Bollo [Sun, 8 Jul 2018 16:58:00 +0000 (18:58 +0200)]
hello3: Fix a bug

The request was released without any need.
It came from migration from v2 to v3.

Change-Id: If2558ca247f0db912ce5705fa1fd98f3771dcb1f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-v3: Fix a bug introduced by 8ca7b69 01/15101/2
Jose Bollo [Fri, 6 Jul 2018 14:11:25 +0000 (16:11 +0200)]
afb-api-v3: Fix a bug introduced by 8ca7b69

This bug returned a wrong OpenAPI description
and produced a memory leaak.

It it could be good to rewrite this part using
wrap_json_pack.

Change-Id: Ie0cf03e4434f8674273e9fac3c49a0f9c8196eac
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-cred: Fix memory leak 99/15099/2
Jose Bollo [Fri, 6 Jul 2018 13:07:08 +0000 (15:07 +0200)]
afb-cred: Fix memory leak

Change-Id: I1badca46d9e829c9b9443fce0a1e7d6a5ffad595
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Add valgrind diagnostics 97/15097/2
Jose Bollo [Fri, 6 Jul 2018 13:05:22 +0000 (15:05 +0200)]
coverage: Add valgrind diagnostics

Change-Id: I047f6a1946ba523776abf9f252a3938e945c8028
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoUpdate version to 5.99.FFRC2 47/15047/2
José Bollo [Thu, 5 Jul 2018 17:15:47 +0000 (19:15 +0200)]
Update version to 5.99.FFRC2

Change-Id: I42bdaff39ac5f91c21bee4e4f9ff089ee3040a5b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoSimplify build by introducing queuing function 45/15045/2
José Bollo [Thu, 5 Jul 2018 17:12:50 +0000 (19:12 +0200)]
Simplify build by introducing queuing function

It is not valuable at the end to continue to have this
fake job implementation. So removing it is good.

Change-Id: I930ade3e3a511f0ebfb91292e5725ac3be884d44
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoRemove uses of deprecated macros 43/15043/1
José Bollo [Thu, 5 Jul 2018 15:34:11 +0000 (17:34 +0200)]
Remove uses of deprecated macros

Change-Id: I439e891d92fb34087755e68102fda97c43b5b786
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agosupervision: Exclude conditionaly the supervision 41/15041/1
José Bollo [Thu, 5 Jul 2018 15:17:35 +0000 (17:17 +0200)]
supervision: Exclude conditionaly the supervision

Exclude from the binder the part related to the supervision
when the supervisor is excluded from the build.

Change-Id: I41193122d63e47b9f0db7f113f88d2d63b783027
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoSimplify build process 39/15039/1
José Bollo [Thu, 5 Jul 2018 14:27:54 +0000 (16:27 +0200)]
Simplify build process

Allows to compile all files even if it isn't
required to simplify the build process.

Change-Id: Ie09e99794aa9f57b179c7e4cfa882859958beb7a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agolocale-root: fixed uninitialized variable 21/15021/1
Thierry Bultel [Thu, 5 Jul 2018 08:21:31 +0000 (10:21 +0200)]
locale-root: fixed uninitialized variable

This has become an error since a gcc update

Change-Id: Ib49bd8c46091efdfe9483bb29a023a4e97c8db2f
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
5 years agoafb-trace: Fix bug in tracing of afb_req_get_client_info 07/15007/1
José Bollo [Wed, 4 Jul 2018 13:58:02 +0000 (15:58 +0200)]
afb-trace: Fix bug in tracing of afb_req_get_client_info

The utility wrap-json distinguishes o from O, the latest
increment the reference count, as expected.

Bug-AGL: SPEC-1563

Change-Id: I4490ac894059e47abf1e2474aab07249b862e985
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-client-demo: Fix bug that forbids interactive behaviour 05/15005/1
José Bollo [Wed, 4 Jul 2018 12:59:58 +0000 (14:59 +0200)]
afb-client-demo: Fix bug that forbids interactive behaviour

Latest change that added script compatibility
(see 1f9e60c) introduced a regression that made
afb-client-demo not useable interactively.

Bug-AGL: SPEC-1562

Change-Id: I1e0ca5caa23ee9838ba8691f384db3d0b13bd488
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-req: Fix a bug in afb_req_verbose 03/15003/1
José Bollo [Wed, 4 Jul 2018 10:23:43 +0000 (12:23 +0200)]
afb-req: Fix a bug in afb_req_verbose

The newer version of afb_req_verbose was self recursive
leading the crashes.

Bug-AGL: SPEC-1561

Change-Id: I40959e5b72ca850712c27a505e77efea43aadabd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agosaha -> salam: To continue using hello 75/14975/1
Jose Bollo [Tue, 3 Jul 2018 16:52:25 +0000 (18:52 +0200)]
saha -> salam: To continue using hello

My memory has hole and thought that saha was
hello in arabian but it is thank you.

To avoid misplaced suceptibility, i also adde shalom.

Change-Id: I493d91fe79c9ce1a2b1a0318883e2cb26a43eb87
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agodoc: Tiny improvement 73/14973/1
Jose Bollo [Tue, 3 Jul 2018 15:11:49 +0000 (17:11 +0200)]
doc: Tiny improvement

Change-Id: I3e8b0cbbe925d9536722962ed1ddc8a63cdbc08a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoImprove readdirs to follow symbolic links 71/14971/1
Jose Bollo [Tue, 3 Jul 2018 13:53:18 +0000 (15:53 +0200)]
Improve readdirs to follow symbolic links

The use of symbolic links can be helpful in
some cases. That modification takes care of
allowing symbolic links in the exploration
of directories.

Change-Id: I54d9004187ba5942410aca37b890cd4f6925177d
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Add the missing files 69/14969/1
José Bollo [Tue, 3 Jul 2018 16:42:32 +0000 (18:42 +0200)]
coverage: Add the missing files

The files weren't included due to git and gitignore.

Also add a README.md to reproduce the test.

Change-Id: Ifcdffaca32c369b2ff5fb82e246fa0cad87813f5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Add coverage test 23/14623/1 5.99.1 flounder/5.99.1 flounder_5.99.1
José Bollo [Fri, 22 Jun 2018 16:30:43 +0000 (18:30 +0200)]
coverage: Add coverage test

This is a first version of the coverage tests.

Change-Id: Iec2feaba12c369b2ff5fb82e246fa0cad87813f5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agomain-afb-client-demo: Allow scripting 21/14621/1
José Bollo [Fri, 22 Jun 2018 16:25:25 +0000 (18:25 +0200)]
main-afb-client-demo: Allow scripting

This version allows to pipe from a script shell.

Change-Id: Ia2bb3e059b8a5a1b097178d2883ef385e7efcdca
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-autoset: Automatic prefix with unix: 19/14619/1
José Bollo [Fri, 22 Jun 2018 16:24:46 +0000 (18:24 +0200)]
afb-autoset: Automatic prefix with unix:

Change-Id: I325d768b3bdfcb313b57e1752cbc156b3735b55a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-v3: Refactor verb description 17/14617/1
José Bollo [Fri, 22 Jun 2018 16:20:35 +0000 (18:20 +0200)]
afb-api-v3: Refactor verb description

Change-Id: Iaa1719ee2891d470f8229c6f1b98dd34265593a6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-so: accept symbolic links for bindings 15/14615/1
José Bollo [Fri, 22 Jun 2018 16:18:31 +0000 (18:18 +0200)]
afb-api-so: accept symbolic links for bindings

Change-Id: I1ef90b0f889767d04f84c8c7eb27d19c04390b15
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agohello3: Add verbs 13/14613/1
José Bollo [Fri, 22 Jun 2018 16:00:44 +0000 (18:00 +0200)]
hello3: Add verbs

Add the following verb for testing purpose:

 - close:    close the session
 - set-loa:  set the LOA of the session
 - setctx:   set the contextual data of a session
 - setctxif: set the contextual data of a session if not already set
 - getctx:   get the contextual data of a session
 - info:     returns the info of the session

Change-Id: Ie2ceb897ecdff01f6efd0a3b174b5794913726d9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoapi-v3: Add monitoring of faults in preinit functions 11/14611/1
José Bollo [Fri, 22 Jun 2018 12:05:28 +0000 (14:05 +0200)]
api-v3: Add monitoring of faults in preinit functions

Change-Id: I0abea1aa62d86372f07f61b7c5dc2e854137f99a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-client-demo: Add option to keep running 09/14609/1
José Bollo [Fri, 22 Jun 2018 12:00:43 +0000 (14:00 +0200)]
afb-client-demo: Add option to keep running

This option allows to keep the client running
even when its input is closed. This will be used for
tests and for reporting because it allows to write:

  echo 'monitor trace {"add":{"api":"*","request":"*","event":"*","session":"*","global":"*"}}' |
  afb-client -k $WSURL > logfile

to capture all events.

Change-Id: If1c7804556190fd8ec9388260fe014c50b498b1d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoImprove documentation of api v3 89/14589/3
José Bollo [Tue, 19 Jun 2018 18:16:28 +0000 (20:16 +0200)]
Improve documentation of api v3

The documentation is improved to reflect the new version.

Tune the options

Change-Id: I894c3db3bc0c10e89db66a9a51a9ad049bb8c0c4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agopackaging: Add V3 demo files 55/14555/1
Ronan Le Martret [Wed, 20 Jun 2018 13:06:00 +0000 (15:06 +0200)]
packaging: Add V3 demo files

Change-Id: Ia9b047bf01543f7cc1c794d91bf479d9848509d3
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
5 years agopackaging: Update spec and deb packaging 43/14543/1
Ronan Le Martret [Mon, 14 May 2018 16:21:23 +0000 (18:21 +0200)]
packaging: Update spec and deb packaging

 - sort files by packaging type

Change-Id: Ic914b5eedffce04356bb59db36be30ba81a8a20d
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
5 years agoFix a warning in using readlink 37/14537/1
José Bollo [Tue, 19 Jun 2018 16:27:36 +0000 (18:27 +0200)]
Fix a warning in using readlink

The use of the same buffer as input and output of readlink
leads to warnings due to restrict use in new versions of
GLIBC

Change-Id: Ifbf1277b88bd18a9df1e18211d4248e94c16d6da
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix warnings due to json-c evolution 35/14535/1
José Bollo [Tue, 19 Jun 2018 16:25:34 +0000 (18:25 +0200)]
Fix warnings due to json-c evolution

The library json-c now returns size_t instead of
int when querying length of arrays.

Change-Id: Id52bb8e77da12cb01e61e1a7c7f4ae2fcbe4634e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hsrv: Add processing of type application/json 95/14495/2
jobol [Mon, 18 Jun 2018 11:10:45 +0000 (13:10 +0200)]
afb-hsrv: Add processing of type application/json

Makes the data posted as application/json directly
available through json.

The previous processing made content transmitted
with the content-type application/json available as
a string in the field of name "" of the returned
json object.

Change-Id: I11615b9b147ee4daa1b1358c2bd36fd839d8a7a9
Signed-off-by: jobol <jose.bollo@iot.bzh>
5 years agoapi-v3: First draft 63/14363/3
José Bollo [Mon, 9 Apr 2018 16:16:07 +0000 (18:16 +0200)]
api-v3: First draft

This commit introduces the bindings v3 API for bindings.

The documentation has still to be improved and will come
very soon.

Change-Id: I8f9007370e29f671fdfd1da87fff7372a17db7af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Switch back to sd_event 61/14361/1
jobol [Mon, 11 Jun 2018 14:54:37 +0000 (16:54 +0200)]
jobs: Switch back to sd_event

Change-Id: I8c9de83d857844b1c5d0d2d26385dbf19fcae228
Signed-off-by: jobol <jose.bollo@iot.bzh>
5 years agoafb-trace: Restore microsecond time 59/14359/1
José Bollo [Fri, 18 May 2018 23:45:36 +0000 (01:45 +0200)]
afb-trace: Restore microsecond time

This allow to use accurately float 64 bits for times
from 1970 to 2112.

Change-Id: I8f57a57edbf5469f827c0eeb80191de934d9841e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agogitignore: Ignore netbean files from nbproject/ 57/14357/1
José Bollo [Thu, 17 May 2018 09:55:29 +0000 (11:55 +0200)]
gitignore: Ignore netbean files from nbproject/

Change-Id: Ic89f9dde8111a20e8dfc5f536ec0e731b2b49df7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFixed spelling 55/14355/1
Sebastien Douheret [Fri, 1 Jun 2018 13:00:15 +0000 (15:00 +0200)]
Fixed spelling

Change-Id: Id7c183face3179a3b9cec7ed128e3a2561d9f3ad
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
5 years agoafb-client-demo: real raw output when --raw is set 53/14353/1
Sebastien Douheret [Fri, 1 Jun 2018 12:45:41 +0000 (14:45 +0200)]
afb-client-demo: real raw output when --raw is set

Having a 'real' raw output allows to pipe output with useful tools like jq.
For example:
 afb-client-demo 'localhost:5555/api?token=HELLO&uuid=c' hello ping | \
 jq .request.status

Change-Id: Ib871a257375bec26f315cdcdbb590033b645ac9d
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
5 years agoafb-client-demo: improved usage message 51/14351/1
Sebastien Douheret [Fri, 1 Jun 2018 12:38:11 +0000 (14:38 +0200)]
afb-client-demo: improved usage message

Change-Id: Ia529be2bf17d9bce3adfc5cb052afd724ae7bbdf
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
5 years agonetbean: update netbean config 49/14349/1
José Bollo [Thu, 17 May 2018 09:55:29 +0000 (11:55 +0200)]
netbean: update netbean config

Change-Id: I3c5e0e875cc5f16c8d366694b4a131768ab8ccd8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-client-demo: Add option -e/--echo 47/14347/1
José Bollo [Thu, 17 May 2018 09:44:09 +0000 (11:44 +0200)]
afb-client-demo: Add option -e/--echo

This option prints the command sent in the same way that it prints
the received actions.

Change-Id: I55d74f7b8645185f93e3b163cb772c8eb515fad0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agowrap-json: Update and fixes for y/Y 45/14345/1
José Bollo [Tue, 15 May 2018 07:20:44 +0000 (09:20 +0200)]
wrap-json: Update and fixes for y/Y

Change-Id: I9026f3498a4860851a41a0d5d56d1880ece75306
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hook: Factorize call to pattern matching 43/14343/1
José Bollo [Fri, 4 May 2018 10:12:30 +0000 (12:12 +0200)]
afb-hook: Factorize call to pattern matching

The pattern matching actually use fnmatch but this
could be changed in the futur to some lighter version.

Change-Id: I4f3617cd4a5bdf95988428cb184cef9e9543771d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-apiset: manage deletion of apis 41/14341/1
José Bollo [Fri, 27 Apr 2018 13:55:43 +0000 (15:55 +0200)]
afb-apiset: manage deletion of apis

Change-Id: If8b4a2b8773e5e7ce3ae62839193c611eefcb811
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hook: Refactor timestamps of hooks and trace 39/14339/1
José Bollo [Wed, 25 Apr 2018 14:48:58 +0000 (16:48 +0200)]
afb-hook: Refactor timestamps of hooks and trace

Change-Id: Iebcab280123d1f954eda3b1260d0b984ae3a98b5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Fix minor errors 37/14337/1
José Bollo [Wed, 18 Apr 2018 15:07:48 +0000 (17:07 +0200)]
jobs: Fix minor errors

Change-Id: I78aeb16fb1cf5b029fb24704d16c42152f9cc909
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years ago.gitignore: Ignore KDevelop files 35/14335/1
José Bollo [Tue, 17 Apr 2018 07:42:15 +0000 (09:42 +0200)]
.gitignore: Ignore KDevelop files

Change-Id: I832f09f44f00152bf2f1bbfc1f82bc4b7c9585e7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agowrap-json: Sync with app-afb-helpers-submodule 33/14333/1
José Bollo [Fri, 13 Apr 2018 07:53:26 +0000 (09:53 +0200)]
wrap-json: Sync with app-afb-helpers-submodule

Change-Id: Idc3360e7b96d5d9dd3fbb39ef97b3dc5d50c54bb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>