src/app-framework-binder.git
5 years agoFix native deb pkg install dependency sandbox/ronan/test_libmicrohttpd_cleanup
Ronan Le Martret [Thu, 4 Oct 2018 09:03:38 +0000 (11:03 +0200)]
Fix native deb pkg install dependency

agl-app-framework-binder-bin failed to install on Ubuntu 18.04.
(libmicrohttpd is named libmicrohttpd12)

Change-Id: Ic1e760c422a9ea1d294d1bec614aa7b134c5b042
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
5 years agoafb-export: Emit a warning on bad 'afb_require_api' call 53/16753/1 6.90.0 guppy/6.90.0 guppy_6.90.0
José Bollo [Tue, 18 Sep 2018 09:03:23 +0000 (11:03 +0200)]
afb-export: Emit a warning on bad 'afb_require_api' call

The call to 'afb_require_api' in a preinit was forbiden
before binding v3 refactoring. Since v3 it is made possible
by deferring the requirement to the initialisation step.
But this may lead to bad behaviour if someone use the
call to test whether an api exists or not. This commit
introduce a message that could warn a developper raising
that issue.

Change-Id: Icc14c3887d70f73d87da0e664bb0e5e961867b4a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-socket: API name cares of abstract UDS 51/16751/1
Jose Bollo [Thu, 13 Sep 2018 10:18:44 +0000 (12:18 +0200)]
afb-socket: API name cares of abstract UDS

Change-Id: Ie485672d8f66ff32ea20cb0eb313690ba380db4a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-session: Fix an issue in managing sessions 29/16629/1
José Bollo [Fri, 14 Sep 2018 08:14:31 +0000 (10:14 +0200)]
afb-session: Fix an issue in managing sessions

Probably an old copy/paste error in the commit
d45426257d5149c735e33e3055220625a919e7bc

It doesn't affect version EE (Electric Eel).

Bug-AGL: SPEC-1735

Change-Id: Ia1536e141ac12275000196a3218eb62d77b36a06
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoCMakeLists: Use AGLVERSION if set 05/16605/1
José Bollo [Wed, 12 Sep 2018 12:35:03 +0000 (14:35 +0200)]
CMakeLists: Use AGLVERSION if set

And default the version to the next version of AGL
pre-guppy: 6.90.0

Change-Id: I5955add9307dd2d07a071383950839f1137e7705
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-apiset: fixed the error message upon api open. 01/16501/1 5.99.6 flounder/5.99.6 flounder_5.99.6
Thierry Bultel [Fri, 7 Sep 2018 15:09:47 +0000 (17:09 +0200)]
afb-apiset: fixed the error message upon api open.

just a typo

Change-Id: I2963c2568cffdc89f577e99f2280da6dcb732b04
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
5 years agoafb-session: Use ad-hoc pseudo-random uuid 81/16481/1
Jose Bollo [Thu, 6 Sep 2018 14:01:20 +0000 (16:01 +0200)]
afb-session: Use ad-hoc pseudo-random uuid

The use of the generator given by the lib uuid
implies the use of the system call 'getrandom'
without the flag GRND_NONBLOCK. It has a weird
effect on boot because many binders require
the generation of uuid at the same time but
getrandom is subject to starving.

This introduced a tiny pseudo-random generation
of UUID that does not implies the use of 'getrandom'.

Bug-AGL: SPEC-1655

Change-Id: I5131072881d7a53f0edda9e36762985c96a04550
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoVERSION 5.99.FFRC6 75/16475/2
Jose Bollo [Thu, 6 Sep 2018 08:48:40 +0000 (10:48 +0200)]
VERSION 5.99.FFRC6

Also add newline at end of .gitreview

Change-Id: I826ecaf695a40dd883a690125fe8e2bffce1cd87
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoMerge "main-afb-daemon: Export API after initialization"
José Bollo [Thu, 6 Sep 2018 08:25:47 +0000 (08:25 +0000)]
Merge "main-afb-daemon: Export API after initialization"

5 years agomain-afb-daemon: Export API after initialization 69/16469/2
Jose Bollo [Wed, 5 Sep 2018 12:25:50 +0000 (14:25 +0200)]
main-afb-daemon: Export API after initialization

Exporting API after initialization is a simple technic
to avoid interleaving of incoming foreign calls during
initialisation.

Also a tiny fix in jobs.c and afb-socket.c.

Bug-AGL: SPEC-1724

Change-Id: I59596256481c8afcd88755ec303bf7f881b55c12
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoapp-framework-binder doc: Changed doc to fit new format. 33/16433/1 5.99.5 flounder/5.99.5 flounder_5.99.5
CorentinLGS [Fri, 31 Aug 2018 07:39:04 +0000 (09:39 +0200)]
app-framework-binder doc: Changed doc to fit new format.

-Split book.json in 2.
-Deleted unwanted files.
-Changed all links to .html files to .md files in the SUMMARY.md,
it is used by gitbook to build the pdf and as gitbook
doesn't handle .html files I had to change it.

Change-Id: I15705ef0f0d9143971c046ccb72a4eee04b98890
Signed-off-by: CorentinLGS <corentinlgs@gmail.com>
5 years agoAllow choice to trap or not program faults 89/16389/1
José Bollo [Tue, 28 Aug 2018 15:15:12 +0000 (17:15 +0200)]
Allow choice to trap or not program faults

The binder traps faults by default to recover as much as
possible from unexpected errors.

Developers may need to remove that behaviour to get core file.

This introduces 2 ways to set or remove the trapping of faults:

 - the environment variable AFB_TRAP_FAULTS

 - the command line option --trap-faults

Both take a boolean value set using on of the following words:

 1  yes  true   on    -- enable trapping of faults (the default)
 0  no   false  off   -- disable trapping of faults

Bug-AGL: SPEC-1702

Change-Id: I6c6a3b933dbda9922a6079c390a601c533d49e55
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agomain-afb-daemon: Set AFB_ROOTDIR and AFB_WORKDIR in environment 83/16383/2
Jose Bollo [Mon, 27 Aug 2018 16:25:30 +0000 (18:25 +0200)]
main-afb-daemon: Set AFB_ROOTDIR and AFB_WORKDIR in environment

It may be difficult to retrieve the root directory from bindings
and from process spawn by option --exec.

In the same way, well identifying the workdir might interest
programs or bindings.

So, from now, the environment variables below are set:

 - AFB_ROOTDIR: identify the rootdir as set by --rootdir
   and in the context of AGL it will be the widget directory

 - AFB_WORKDIR: identify the workdir as set by --workdir

To avoid any confusion, the function realpath is used to export
absolute path names.

Bug-AGL: SPEC-1694

Change-Id: Id272e009ca975e28aaab8b14fa2a98fbd2216e73
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hook-flags: Fix a compilation warning 45/16345/1
Jose Bollo [Mon, 27 Aug 2018 11:19:19 +0000 (13:19 +0200)]
afb-hook-flags: Fix a compilation warning

Change-Id: Ic9d1cc44ef1bbf6db4afe8eb7016b05f4cddb9a4
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agojobs: Abort when systemd's event loop lost 67/16267/1 5.99.4 flounder/5.99.4 flounder_5.99.4
José Bollo [Thu, 23 Aug 2018 10:23:39 +0000 (12:23 +0200)]
jobs: Abort when systemd's event loop lost

When sd_event_prepare returns an error there is currently
no way to restore the event loop working.

It happens when a callback of an sd_event is faulty
(ex: SIGSEGV). In that case the monitoring of signals
(sig-monitor) interfer badly with systemd. But at the
the application firstly has error.

To avoid flooding the journal with messages, aborting
is the best solution.

Bug-AGL: SPEC-1681

Change-Id: If01295f07b3c3fc8c8ec1ac5bf04840d42ee9774
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-stub-ws: Add reconnection of ws-clients on need 65/16265/1
José Bollo [Tue, 21 Aug 2018 19:15:31 +0000 (21:15 +0200)]
afb-stub-ws: Add reconnection of ws-clients on need

This implementation detects deconnections and try to reconnect
lazily on need.

Bug-AGL: SPEC-1668

Change-Id: Ib2a20a4578f2da80afe1564c42de96c4aa250e64
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-stub-ws: Safe handling of deconnections 55/16255/3
Jose Bollo [Mon, 20 Aug 2018 15:30:55 +0000 (17:30 +0200)]
afb-stub-ws: Safe handling of deconnections

This commit also include many comments and
improvements in naming of functions.

Bug-AGL: SPEC-1668

Change-Id: I1b5dd95678d94e9edfca1c598c5697e90bb9e5bf
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-stub-ws: Process error on call to remote 53/16253/2
José Bollo [Tue, 21 Aug 2018 12:31:41 +0000 (14:31 +0200)]
afb-stub-ws: Process error on call to remote

Change-Id: I8bb96419cfac3da88e75da42c66a5d359ec7c666
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoSend error replies on disconnection 51/16251/2
Jose Bollo [Mon, 20 Aug 2018 15:45:42 +0000 (17:45 +0200)]
Send error replies on disconnection

The pending calls receive an error notification
when the server hang up.

Bug-AGL: SPEC-1668

Change-Id: I052dca5e338a7650d7630856e21f1d3a81c6f265
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-wsj1: Split 'wsj1_on_text' in 2 49/16249/2
José Bollo [Tue, 21 Aug 2018 11:37:51 +0000 (13:37 +0200)]
afb-wsj1: Split 'wsj1_on_text' in 2

This improves the code and also prepare answering
diconnected on server hangup.

Bug-AGL: SPEC-1668

Change-Id: I2cf5a75bc2db6e9a0fd0cab88c7ff3cb9fd06242
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-stub-ws: Clean up 47/16247/2
Jose Bollo [Mon, 20 Aug 2018 15:35:27 +0000 (17:35 +0200)]
afb-stub-ws: Clean up

Change-Id: I6fbe737d4986fd18f9675942cd7ad75966125343
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-ws: Use afb-socket features 43/16243/1
Jose Bollo [Mon, 20 Aug 2018 14:53:27 +0000 (16:53 +0200)]
afb-api-ws: Use afb-socket features

Use the feature of afb-socket to handle
the api name.

Bug-AGL: SPEC-1668

Change-Id: Ib13891d7948c75bc5d342b45c774f8e6c3ea016e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
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>