src/app-framework-binder.git
6 years agoFix: C++ compilation warning using genskel 85/10685/2
Romain Forlot [Thu, 24 Aug 2017 13:25:12 +0000 (15:25 +0200)]
Fix: C++ compilation warning using genskel

Unitialized struct member.

Change-Id: Ib507aef4ceb459571b6bb70e5a879e1f34823a77
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
6 years agogenskel: fix bug in namings
José Bollo [Wed, 23 Aug 2017 17:41:14 +0000 (19:41 +0200)]
genskel: fix bug in namings

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-monitor: update hooks for tracing
José Bollo [Wed, 23 Aug 2017 16:45:09 +0000 (18:45 +0200)]
afb-monitor: update hooks for tracing

Updating hooks is needed (at the moment) after trace requests

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agogenskel: improvements and bug fixs
José Bollo [Wed, 23 Aug 2017 16:41:51 +0000 (18:41 +0200)]
genskel: improvements and bug fixs

- Fills the info fields
- take care of C in names

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: improvements
José Bollo [Fri, 11 Aug 2017 14:57:53 +0000 (16:57 +0200)]
afb-stub-ws: improvements

The client stub isn't connecting anymore
automatically to the apiset. The function
'afb_stub_ws_client_add' provides the feature.

The client now returns a afb_api structure.

name and on_hangup features added.

Change-Id: I204cc39adeb782f5d40360c22c79d14f54dd5c63
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-apiset: add a wrapper for 'describe'
José Bollo [Fri, 11 Aug 2017 09:08:56 +0000 (11:08 +0200)]
afb-apiset: add a wrapper for 'describe'

And use it in monitor.

Change-Id: I9efbd19cfbdc665d1d686831b529ebaa7bd917a2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-websocket: update websocket protocol
José Bollo [Fri, 11 Aug 2017 14:46:59 +0000 (16:46 +0200)]
afb-websocket: update websocket protocol

After integration of UPGRADE in libmicrohttpd,
the header "Connection: Upgrade" has to be removed
because it is now sent 2 times.

This caused Webkit to fail to connect its websocket.

Bug-AGL: SPEC-821

Change-Id: Ib9744208cf7175f0c56e513b18b53ab0a9b60b9f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-debug: expose wait/break features
José Bollo [Thu, 10 Aug 2017 13:36:05 +0000 (15:36 +0200)]
afb-debug: expose wait/break features

Change-Id: I197350dee4f85dfc167ea4ffcb54e6e3ceba89ad
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosubpath: creation for splitting locale-root
José Bollo [Thu, 10 Aug 2017 10:11:31 +0000 (12:11 +0200)]
subpath: creation for splitting locale-root

Change-Id: Ia339dc1d1291ef52fbec3c928537721ed7410694
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-xreq: handle when no reply was sent
José Bollo [Thu, 10 Aug 2017 09:43:10 +0000 (11:43 +0200)]
afb-xreq: handle when no reply was sent

Send an error reply if no reply was sent.

Change-Id: Ibc5c98d22b9820f1f0b5370083f79a52213ddc61
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-ws: typo
José Bollo [Wed, 9 Aug 2017 09:16:27 +0000 (11:16 +0200)]
afb-api-ws: typo

Change-Id: Iea02e0720e40c2b4630a15606e798c53b4bbfe6c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-evt: fix a bug discovered by clang-check
José Bollo [Tue, 8 Aug 2017 16:16:07 +0000 (18:16 +0200)]
afb-evt: fix a bug discovered by clang-check

Change-Id: I6bb1dffeb17fdcaf6e3a2686651d35dd0b0500b9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: fix an over allocation
José Bollo [Tue, 8 Aug 2017 15:50:21 +0000 (17:50 +0200)]
afb-session: fix an over allocation

Thanks to Markus Fritzsch and clang-check

Change-Id: I4822eb14bff49680df05e472363228cc82566edf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosig-monitor: dump the stack on SIGABRT
José Bollo [Tue, 8 Aug 2017 10:17:55 +0000 (12:17 +0200)]
sig-monitor: dump the stack on SIGABRT

Change-Id: Id21c444d6d18a78f731458a43519a131515385c0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd specific permission for monitor/trace
José Bollo [Tue, 8 Aug 2017 10:14:51 +0000 (12:14 +0200)]
Add specific permission for monitor/trace

Change-Id: I39c9295596e1c328533319354dddbf5191f11463
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: Add tracing features to API monitor
José Bollo [Mon, 31 Jul 2017 15:50:13 +0000 (17:50 +0200)]
afb-trace: Add tracing features to API monitor

This api allows to receive events when particular actions
are reached.

At the moment, tracing is bound to the API monitor
and can trace anything. In the future, this will not be
the case and the API monitor will only allow to trace
requests of its session. The tracing of all will
be available for supervision only.

Change-Id: I880852612c2f77ff5329496b16c75fe602db4090
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-cred: fix default values
José Bollo [Thu, 3 Aug 2017 10:16:58 +0000 (12:16 +0200)]
afb-cred: fix default values

Because SO_PEERCRED returns without error even when no data
is available (tcp by example), the resulting uid is now tested.

Also, for tcp, by default avoid by default to create a default
user value. Instead, return NULL. This will allow client having
an HTTP/Websocket connection to get full rights on the binder.

Change-Id: I2defb585bf79c023e2391c2e18d6de17e5112770
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosubcall_req: introduce afb_req_subcall_req
José Bollo [Wed, 2 Aug 2017 17:14:09 +0000 (19:14 +0200)]
subcall_req: introduce afb_req_subcall_req

The function 'afb_req_subcall_req' can be used to make asynchronous
subcalls. It improves the function 'afb_req_subcall' by automatically
keeping the request opened for the callback and by passing it, the
request, as an extra argument of the callback.

Change-Id: I2dc79c01fc25c7a65b9c8cc9e001a5b85fba99df
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-xreq: integration of subcalls
José Bollo [Wed, 2 Aug 2017 16:48:27 +0000 (18:48 +0200)]
afb-xreq: integration of subcalls

The file afb-subcall is now integrated within
afb-xreq. It improves memory allocation and
performance of synchronous calls.

Change-Id: I4190199babbe0559527438b530b19ac9a35ec38b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-svc: allows NULL for callbacks or results
José Bollo [Mon, 31 Jul 2017 15:46:32 +0000 (17:46 +0200)]
afb-svc: allows NULL for callbacks or results

This allows afb_service_call to set NULL callback
and afb_service_call_sync to set a NULL result pointer.

Change-Id: Ie16ae5557e6851d2f1e730ad32450489242b5daa
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix fallthrough warnings
José Bollo [Mon, 31 Jul 2017 14:46:23 +0000 (16:46 +0200)]
Fix fallthrough warnings

Change-Id: Ibe8e0b4e59ad4d5f0b0cca82ccdb3d0f035b0501
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: renaming
José Bollo [Mon, 31 Jul 2017 14:33:37 +0000 (16:33 +0200)]
afb-hook: renaming

Change-Id: Ie1ac2eb96fb29711c38750c3babe7cbd4b472079
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowrap-json: add "for_all" functions
José Bollo [Mon, 31 Jul 2017 14:31:47 +0000 (16:31 +0200)]
wrap-json: add "for_all" functions

The "for_all" functions are facilities for handling
collections of json objects

Change-Id: Icaecb39e9f0108e1fb1c42bef2a90935feb312ed
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-evt: add internal push functions
José Bollo [Mon, 31 Jul 2017 14:27:03 +0000 (16:27 +0200)]
afb-evt: add internal push functions

For the implementation of monitoring, the event
should be pushed without hooking internal.

Change-Id: I4372bbc55e78c851db660a69bb2e60995fbdc88f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-evt: unprefix event name
José Bollo [Mon, 31 Jul 2017 14:25:06 +0000 (16:25 +0200)]
afb-evt: unprefix event name

Removes the api prefix of the event name.

Change-Id: I050dc86beb08659751c1e57b8d3ea233bac9e411
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-cred: provide default values of credentials
José Bollo [Mon, 31 Jul 2017 13:51:05 +0000 (15:51 +0200)]
afb-cred: provide default values of credentials

Change-Id: I3764edf986c01ef30e21ee1ec7e2b0098eec9e9e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-apiset: reduce verbosity
José Bollo [Mon, 31 Jul 2017 09:48:48 +0000 (11:48 +0200)]
afb-apiset: reduce verbosity

Change-Id: Iceffd965f12f7afe658e374c29f13ab0abc8bb19
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowrap-json: Fix warnings
José Bollo [Mon, 31 Jul 2017 11:14:40 +0000 (13:14 +0200)]
wrap-json: Fix warnings

Fixes maybe-uninitialized warning

Change-Id: I5416fb2c6cc017ddc53984475432fff90c41d42b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agodebugging: add calls to 'personality'
José Bollo [Mon, 31 Jul 2017 09:29:03 +0000 (11:29 +0200)]
debugging: add calls to 'personality'

Insertion of calls to personality for the only
pupose to be able to set breakpoint at some
strategic places.

The chosen places are:
 - After the debug wait point. The intend is to
   allow simulation of breakpoint after attaching
   to the waiting process.
 - Before starting the bindings but after loading
   it. The intend is to allow loading of symbols and
   setting of breakpoints in the debugged binding
   without attaching to afb-daemon that comes without
   debug symbols.

Change-Id: Ie3bfce0956c9844586c7a5f8bd820acb7f58772c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agodebug: allow break after wait
José Bollo [Fri, 28 Jul 2017 07:54:20 +0000 (09:54 +0200)]
debug: allow break after wait

Change-Id: I634abe531606a30ba241c85bf650589c5f0ea4ca
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-monitor: use of wrap-json unpacking
José Bollo [Thu, 27 Jul 2017 14:48:50 +0000 (16:48 +0200)]
afb-monitor: use of wrap-json unpacking

Change-Id: Ibfcaa34c32cb4bbdedbaee08360ef829321c3035
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowrap-json: add unpacking tool for json
José Bollo [Thu, 27 Jul 2017 13:55:45 +0000 (15:55 +0200)]
wrap-json: add unpacking tool for json

The functions wrap_json_unpack, wrap_json_vunpack,
wrap_json_check, wrap_json_vcheck, wrap_json_match and
wrap_json_vmatch can be used to get items in a json
object.

These functions are likely to be compatible in the
format with the unpacking functions of the library
jansson [1].

[1] http://jansson.readthedocs.io/en/2.10/apiref.html#parsing-and-validating-values

Change-Id: I18ad702498b9a70215d88b2a3c13bd0f6194bb45
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowrap-json: add packing tool for json
José Bollo [Wed, 26 Jul 2017 18:02:13 +0000 (20:02 +0200)]
wrap-json: add packing tool for json

The functions wrap_json_pack and wrap_json_vpack
can be used to create json object. These functions
are likely to be compatible in the format with the
packing functions of the library jansson [1].

[1] http://jansson.readthedocs.io/en/2.10/apiref.html#building-values

Change-Id: I2e251bdb9b590ba55707c5a9ed60528cad927fb3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoupdate markdown documentation 25/10425/1
Ronan Le Martret [Thu, 27 Jul 2017 14:28:22 +0000 (16:28 +0200)]
update markdown documentation

Change-Id: I4f466ff4b965022998d2418a9c1310d4f5e0188e
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoMissing member on new binding v2 struct. 05/10205/1
Romain Forlot [Mon, 17 Jul 2017 09:04:49 +0000 (11:04 +0200)]
Missing member on new binding v2 struct.

Change-Id: I5fc248d0fcbf3fb8d8cb25138778b11da7cd039a
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
6 years agoFix const issue in afb-auth.h
José Bollo [Thu, 13 Jul 2017 09:45:59 +0000 (11:45 +0200)]
Fix const issue in afb-auth.h

The fields type and loa were declared as const.
This worked well for C compilers that are allowing
to initialize constant fixed structures.

But when compiling with C++, it is no more easy
to create initialized structure explicitely.
In C++, the solution is to use C++14 constexpr functions.
But for using these function, const must be removed.

Bug-AGL: SPEC-741

Change-Id: I8096db6e4eba020f96fbf25789b2990d2a8cbabf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agodebug: Create a file indicating the waiting point
José Bollo [Thu, 6 Jul 2017 08:59:14 +0000 (10:59 +0200)]
debug: Create a file indicating the waiting point

When AFB_DEBUG_WAIT is used, the file /tmp/afb-debug-<PID>
is created and contains the name of the awaiting point
(without tailing new line)

Signals other than SIGINT are ignored when waiting
for SIGINT. This improves the cleaning up. Example:
the signal SIGTERM is delayed until after removal of
the debugging indication file.

Change-Id: I5c896e4d9a3a098affc18d4282e260d9bb253611
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-debug: add features for debugging
José Bollo [Wed, 5 Jul 2017 11:39:27 +0000 (13:39 +0200)]
afb-debug: add features for debugging

When compiled with -DAGL_DEVEL or -DAFB_INSERT_DEBUG_FEATURES
afb-daemon interprets the environment variables
AFB_DEBUG_BREAK and AFB_DEBUG_WAIT.

The environment variable AFB_DEBUG_BREAK make afb-daemon emit
a break (SIGINT) that should be treated by the debugger.

The environment variable AFB_DEBUG_WAIT make afb-daemon wait
for a break (SIGINT) to continue. This can be used to attach
a debugger.

The content of the variables AFB_DEBUG_BREAK and AFB_DEBUG_WAIT
is a list of key names of the point where the action should
occur. The list is separated by spaces or commas ','.

Example:

 AFB_DEBUG_WAIT=main-entry,start-load

The defined points are: main-entry, main-args, main-start,
start-entry, start-load, start-start, start-http, start-call,
start-exec.

Here some of their characteristic:
 - main-entry: at the beginning befaore any other instruction
 - main-args: after parsing arguments
 - main-start: after daemonisation before starting
 - start-entry: at start entry
 - start-load: before loading bindings after initialisation of afb-daemon
 - start-start: after loading bindings befaore starting it
 - start-call: after init before starting HTTP server
 - start-http: after http server, before calling startup calls
 - start-exec: before running the --exec command

Change-Id: Id405e749c590fb95f32e30a7d37c30b6412cf0a5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomain: improve start
José Bollo [Wed, 5 Jul 2017 12:35:05 +0000 (14:35 +0200)]
main: improve start

1: emits the correct PID even if daemonized

2: run the startup calls before executing the client (if any)

Change-Id: I7e06961d4a88bc6083aa1bc48ccedf57b76ea268
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMake status common
José Bollo [Mon, 3 Jul 2017 11:57:19 +0000 (13:57 +0200)]
Make status common

Make all error status for bindings use
a common convention: a negative value
means an error.

Change-Id: Id09610051295810f04f00477d7ec1d9771bf7975
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoupdate libmicrohttpd to 0.9.55
José Bollo [Mon, 3 Jul 2017 08:08:51 +0000 (10:08 +0200)]
update libmicrohttpd to 0.9.55

Change-Id: I47e00996d57eae29e846759cbb53d93c2803da6c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoUpdate libmicrohttpd verion for native build 11/10011/1
Ronan Le Martret [Mon, 3 Jul 2017 07:43:57 +0000 (09:43 +0200)]
Update libmicrohttpd verion for native build

Change-Id: Iaefdfe8a358b0ef864dce6740b9aae44f4495423
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoBindings V2: enforce prefix AFB_ to logging macros
José Bollo [Fri, 30 Jun 2017 15:17:56 +0000 (17:17 +0200)]
Bindings V2: enforce prefix AFB_ to logging macros

This might break many codes but it is better in the long term.

Change-Id: I346d13f0a6ef6b211edf25844489405351548299

6 years agoafb-ws-json1: expose addref/unref functions
José Bollo [Fri, 30 Jun 2017 15:16:39 +0000 (17:16 +0200)]
afb-ws-json1: expose addref/unref functions

Change-Id: Ie264540d20e3a7afbbf2cd16cd54508d07f35034

6 years agoChange debian files packaging 35/9835/4
Ronan Le Martret [Tue, 27 Jun 2017 13:18:45 +0000 (15:18 +0200)]
Change debian files packaging

 * rename package app-framework-binder to agl-app-framework-binder.
 * move packaging to conf.d/packaging as other packages

Change-Id: Ia207345836fe3c44aef4d237c5785c537a725a81
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoBindings V2: reintroduce field 'info' for verbs
José Bollo [Wed, 28 Jun 2017 13:51:54 +0000 (15:51 +0200)]
Bindings V2: reintroduce field 'info' for verbs

CAUTION, this breaks binary compatibility

Change-Id: I67acfffe1f04cdddee0ad1230b227b080da1ab06
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix bad error reporting
José Bollo [Wed, 28 Jun 2017 16:08:29 +0000 (18:08 +0200)]
Fix bad error reporting

The use of %m was buggy due to the implementation
of 'vverbose': it always returned ENOTTY

   Inappropriate ioctl for device

Change-Id: Idedeefa44ec3cf301d75cd542c54c35a208886a1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agohandle more exceptionnal signals
José Bollo [Wed, 28 Jun 2017 15:21:21 +0000 (17:21 +0200)]
handle more exceptionnal signals

Change-Id: I956cda0a437c782b1b39689330429bcba06c1804
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd backtrace on errors
José Bollo [Wed, 28 Jun 2017 14:13:42 +0000 (16:13 +0200)]
Add backtrace on errors

Change-Id: Id2ce3a62d97fd4148d661b34f7507d7a4bec4fba
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoUse constants for verbosity and syslog levels
José Bollo [Wed, 28 Jun 2017 13:35:01 +0000 (15:35 +0200)]
Use constants for verbosity and syslog levels

Change-Id: I98a765f7c40d77fbc565ed13aa6e9bba48cf3244
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd new macro for handling verbosity
José Bollo [Wed, 28 Jun 2017 12:44:11 +0000 (14:44 +0200)]
Add new macro for handling verbosity

It might be interesting to test the verbosity
level before making resource consuming stuff.
Se example below:

  if (afb_verbose_notice()) {
      char *s = compute();
      NOTICE("I got %s", s);
      free(s);
  }

Change-Id: I7be4248a86fc2a2a23820ec822b36d9fccafb203
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agodocs: fix book.json (headers/footers)
Stephane Desneux [Tue, 20 Jun 2017 09:38:02 +0000 (11:38 +0200)]
docs: fix book.json (headers/footers)

Change-Id: Ib2d59538d479d7e6e3ed6420fd3ba13ed6f0b695
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
6 years agoMerge "Auto generate cover from book.json fields."
Stéphane Desneux [Tue, 20 Jun 2017 09:25:01 +0000 (09:25 +0000)]
Merge "Auto generate cover from book.json fields."

6 years agodocs: add document revision
Stephane Desneux [Tue, 20 Jun 2017 09:24:17 +0000 (11:24 +0200)]
docs: add document revision

Change-Id: Ie941042d71ed8de25e0ea9fa9bdbb0990e64d5f2
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
6 years agoAuto generate cover from book.json fields. 73/9773/1
Sebastien Douheret [Tue, 20 Jun 2017 07:55:54 +0000 (09:55 +0200)]
Auto generate cover from book.json fields.

Change-Id: I678df3c78ac04fb2f7a8b3f843103d933c95d73c
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
6 years agoAdd page-break for pdf and fix spelling 53/9753/1
Sebastien Douheret [Mon, 19 Jun 2017 10:28:30 +0000 (12:28 +0200)]
Add page-break for pdf and fix spelling

Change-Id: I3225f27a4e45792aeeb418eac5430c93c9d70061
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
6 years agoAdd gitbook documentation (support PDF generation). 51/9751/1
Sebastien Douheret [Mon, 19 Jun 2017 09:40:32 +0000 (11:40 +0200)]
Add gitbook documentation (support PDF generation).

To generate PDF doc:
 ./gendocs.sh pdf

To generate HTML doc (local webserver):
 ./gendocs.sh serve

Change-Id: I77156a45e86f3bcab045cee05694f93b7a50e4ba
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
6 years agoRefactor of the documentation
José Bollo [Wed, 7 Jun 2017 16:40:00 +0000 (18:40 +0200)]
Refactor of the documentation

6 years agoMoves tic-tac-toe sample to V2
José Bollo [Wed, 7 Jun 2017 16:37:45 +0000 (18:37 +0200)]
Moves tic-tac-toe sample to V2

Change-Id: I761bca13f98f9bc9557725ed97979218d79fcbb2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix issue in using systemd socket activation
José Bollo [Mon, 12 Jun 2017 15:34:29 +0000 (17:34 +0200)]
Fix issue in using systemd socket activation

When afb-daemon was launched without systemd it crashed
in sd_fds_for.

Change-Id: I481f5d1a24ec45f8cacae32792b2e47dfa62f611
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd comment for bindings v2
José Bollo [Mon, 12 Jun 2017 11:53:34 +0000 (13:53 +0200)]
Add comment for bindings v2

Change-Id: Ic9c1e89f6f4f5a124ffb2dbb88a26dc5e8e1e543
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRemoves reference to NULL in includes
José Bollo [Wed, 7 Jun 2017 16:38:26 +0000 (18:38 +0200)]
Removes reference to NULL in includes

Change-Id: I94b2d57b8234f607167488afd24364920f9624f0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMerge "Add rpm and deb packaging"
Jan-Simon Moeller [Thu, 8 Jun 2017 10:20:34 +0000 (10:20 +0000)]
Merge "Add rpm and deb packaging"

6 years agoMerge "Add package archive documentation to README.md"
Jan-Simon Moeller [Thu, 8 Jun 2017 10:20:29 +0000 (10:20 +0000)]
Merge "Add package archive documentation to README.md"

6 years agoFix concurrency issue in handling references
José Bollo [Wed, 7 Jun 2017 11:59:08 +0000 (13:59 +0200)]
Fix concurrency issue in handling references

Change-Id: Iaae331fbdadb88f26057a64193a026950dcb56e4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd rpm and deb packaging 13/9613/1
Ronan Le Martret [Tue, 6 Jun 2017 16:44:37 +0000 (18:44 +0200)]
Add rpm and deb packaging

Change-Id: I604cb02ea9a9ee94105583223dbacb4116d299ff
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoAdd package archive documentation to README.md 11/9611/1
Ronan Le Martret [Tue, 6 Jun 2017 16:43:45 +0000 (18:43 +0200)]
Add package archive documentation to README.md

Change-Id: Ic93ae014f56ddd0a2f0d7d12d15005eb1bda1f09
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoAllows to enforce prefixed verbose messages
José Bollo [Mon, 5 Jun 2017 10:53:07 +0000 (12:53 +0200)]
Allows to enforce prefixed verbose messages

Change-Id: I41aa310f6898d5578b8de296d3b637c0d3595b1b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix typedef for afb_stored_req
José Bollo [Fri, 2 Jun 2017 16:02:09 +0000 (18:02 +0200)]
Fix typedef for afb_stored_req

Change-Id: I3c1cbb4a8a5473af5ac520441fecd1e5f3f253b3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd 'afb_daemon_require_api'
José Bollo [Fri, 2 Jun 2017 07:13:06 +0000 (09:13 +0200)]
Add 'afb_daemon_require_api'

This solution is at this time the best one to allow
asynchronous calls within initialisation of bindings.

Change-Id: I21ba3a74b4e93eec238a11dd51bc6b58c483308d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoProvide efficient store/unstore for afb_req
José Bollo [Fri, 2 Jun 2017 14:32:44 +0000 (16:32 +0200)]
Provide efficient store/unstore for afb_req

Change-Id: I231e2506f58227fb8d192df042539b1551a765c5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoLocalize construction of afb_arg
José Bollo [Fri, 2 Jun 2017 13:38:13 +0000 (15:38 +0200)]
Localize construction of afb_arg

Change-Id: I08f1bc228c419243044949aa3c4094873932d3f2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoImprove start_api function
José Bollo [Fri, 2 Jun 2017 13:37:14 +0000 (15:37 +0200)]
Improve start_api function

Change-Id: I8ef676eb501c80a77944f88100119e8ae8784259
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix error on initialisation
José Bollo [Fri, 2 Jun 2017 12:37:35 +0000 (14:37 +0200)]
Fix error on initialisation

Change-Id: If6a988359b4d2747cefdd683b6328f5b36e37548
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix issue when JSON value is NULL in xreq
José Bollo [Fri, 2 Jun 2017 11:19:01 +0000 (13:19 +0200)]
Fix issue when JSON value is NULL in xreq

Change-Id: Ifb84a77abb0fee947fb05d80ac8276a8ede988af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix bug in websocket on empty packets
José Bollo [Thu, 1 Jun 2017 20:14:34 +0000 (22:14 +0200)]
Fix bug in websocket on empty packets

Change-Id: I21d6e36df183b798539cf2a378976cc595a77029
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoEnforce starting services on need
José Bollo [Thu, 1 Jun 2017 17:23:28 +0000 (19:23 +0200)]
Enforce starting services on need

Also remove default api verbs because it wasn't used
actually and it wasn't compatible with this evolution.

Change-Id: I863b99eddd418f771011bb35b4bcea763046224e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofix include of afb-service-v1.h
José Bollo [Thu, 1 Jun 2017 14:44:15 +0000 (16:44 +0200)]
fix include of afb-service-v1.h

Change-Id: I4e756949635854694711590c81fee0b7d99d33b3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofix a warning on 32 bits
José Bollo [Thu, 1 Jun 2017 13:04:23 +0000 (15:04 +0200)]
fix a warning on 32 bits

Change-Id: I03c50694470059f11e47b51a29e3df6929125752
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoImprove log output format
José Bollo [Thu, 1 Jun 2017 11:19:16 +0000 (13:19 +0200)]
Improve log output format

Also rename of field 'prefix' to 'api' in afb_ditf

Change-Id: Iaff49a3e829bca6e33023c888e95fb18fa0b85d8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd hooking for events
José Bollo [Thu, 1 Jun 2017 10:34:29 +0000 (12:34 +0200)]
Add hooking for events

Change-Id: If5fe736e04c9f4298302c3cbba568f1d6346ee67
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd backward compatibility and remarks
José Bollo [Wed, 31 May 2017 15:20:41 +0000 (17:20 +0200)]
Add backward compatibility and remarks

Change-Id: Ia261e2d9efce399b210f834c1acb679215021edd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoReturn API description through websocket
José Bollo [Wed, 31 May 2017 14:47:02 +0000 (16:47 +0200)]
Return API description through websocket

Change-Id: Iab10ed193bf6f6fc4240f6856c5835e35cd85dfa
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoIntroduce typedef for clients
José Bollo [Wed, 31 May 2017 10:31:23 +0000 (12:31 +0200)]
Introduce typedef for clients

Change-Id: Idb71c3ae869046f568166d239cf5addd31d42c6f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agocode formatting improvement
José Bollo [Wed, 31 May 2017 10:15:33 +0000 (12:15 +0200)]
code formatting improvement

Change-Id: I07e0201c4dc9996e47ca70819123b351c7fb2ad7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd logging by request
José Bollo [Wed, 31 May 2017 09:32:46 +0000 (11:32 +0200)]
Add logging by request

Change-Id: I6dda714bcb8c36392c14a1981cfb8960f3db45b8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofix bad exit status report
José Bollo [Wed, 31 May 2017 09:12:41 +0000 (11:12 +0200)]
fix bad exit status report

Change-Id: Ieb3aac9610c3e60702fe709f283f5dc1805623d8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMake api descriptions unique
José Bollo [Tue, 30 May 2017 15:48:05 +0000 (17:48 +0200)]
Make api descriptions unique

Before this commit, the bindings version 1
were described differently from the bindings
version 2.

They now all describes themselves equally using
openAPI 3.

Change-Id: I73c2017d0bcbf3c3b01db0c58b03e328e4f44fda
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdds hooks for service (svc)
José Bollo [Tue, 30 May 2017 14:28:55 +0000 (16:28 +0200)]
Adds hooks for service (svc)

Change-Id: I42265fcee9eae8219ef0cf56d3c8446d2c0fc015
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofix comments
José Bollo [Tue, 30 May 2017 14:28:21 +0000 (16:28 +0200)]
fix comments

Change-Id: I6a3b2df272a1c88c530fd229ba612ee30160e3cc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosample binding "hello" receives events
José Bollo [Tue, 30 May 2017 14:26:51 +0000 (16:26 +0200)]
sample binding "hello" receives events

Change-Id: Ic39d2c025af257703340d1c8f56746b2e27d3818
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofix bug in hooking verbose calls
José Bollo [Tue, 30 May 2017 14:25:56 +0000 (16:25 +0200)]
fix bug in hooking verbose calls

Change-Id: I879d05968521a25cab73f65dad02a52357e62dab
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRecord API names in service descriptors
José Bollo [Tue, 30 May 2017 08:41:56 +0000 (10:41 +0200)]
Record API names in service descriptors

Change-Id: Ie437a6987df7f27a4a68b9c022d8cad8ab4f2cfe
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBindings V1: allows to receive event
José Bollo [Tue, 30 May 2017 07:57:49 +0000 (09:57 +0200)]
Bindings V1: allows to receive event

Don't enforce anymore to have the function
'afbBindingV1ServiceInit' defined when expecting
events through 'afbBindingV1ServiceEvent'.

This will allow to handle broadcasted events.

Change-Id: Ib75904487ad99fdc50813deaf6013f4ba4c47421
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd warning on missing undefined symbols
José Bollo [Mon, 29 May 2017 16:06:55 +0000 (18:06 +0200)]
Add warning on missing undefined symbols

Change-Id: I0ebe3b222cc5f0add9c9d433c0517af4e1910911
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMoves library resolution on top (hack)
José Bollo [Mon, 29 May 2017 16:03:25 +0000 (18:03 +0200)]
Moves library resolution on top (hack)

Avoid to tune executable byu executable.
Should be redefined later.

Change-Id: I02e55e642c1797768b7dbcd8406f59199a56891d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRelax authorisation checlk for self
José Bollo [Mon, 29 May 2017 14:11:49 +0000 (16:11 +0200)]
Relax authorisation checlk for self

Change-Id: I115bbebb2f51be92578d1cc6b2fb5ae89813b630
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd vfail and vsuccess interfaces
José Bollo [Mon, 29 May 2017 13:54:30 +0000 (15:54 +0200)]
Add vfail and vsuccess interfaces

This now factorizes code needed to asprintf
the arguments in an allocated string.

But the most interesting effect is the ability
to handle va_list of arguments. It can be used
for library of tools.

Change-Id: I4ba74c9984786f07abe0c7e53d7ef79dca863735
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoCleanup legacy internal functions
José Bollo [Mon, 29 May 2017 12:56:50 +0000 (14:56 +0200)]
Cleanup legacy internal functions

The functions afb_req_raw and afb_req_send are
internal. They are now no more visible from
bindings.

Change-Id: I1f250a1800168a9c3772375477bf37a501f134a0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd 'afb_service_call_sync' function
José Bollo [Mon, 29 May 2017 12:16:13 +0000 (14:16 +0200)]
Add 'afb_service_call_sync' function

This new function allows to call features for the
services synchronously.

Also refactoring how are handled arguments to
calls. The call to 'json_object_put' is now always
done by the binder.

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