src/app-framework-binder.git
6 years agoMissing member on new binding v2 struct. 13/10213/1 3.99.3 4.0.0 dab/3.99.3 dab/4.0.0 dab_3.99.3 dab_4.0.0
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: Ib332949b63892d9829db31d3c1a64d7d388db744
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: Iea163f87e160f9a99bc10f7365920893752bd308
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
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
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 3.99.2 dab/3.99.2 dab_3.99.2
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 agoAdd .gitreview for dab
Jan-Simon Möller [Sat, 24 Jun 2017 18:10:08 +0000 (20:10 +0200)]
Add .gitreview for dab

Change-Id: Ia739cabd94af1c220b5bbd1e51e007c5e7adec77
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
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>
6 years agoafb-client-demo add options -H and -r
José Bollo [Mon, 29 May 2017 07:28:26 +0000 (09:28 +0200)]
afb-client-demo add options -H and -r

The option -H (or --human) allows to output the
emited JSON object as pretty formatted for being
readable by human.

The option -r (--raw) can be used in this case to
still continue to print the raw output.

Change-Id: I1da531794fb243413741f067cfea79f670c3a626
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofix concurrency for afb_msg_json_reply_error
José Bollo [Wed, 24 May 2017 14:57:49 +0000 (16:57 +0200)]
fix concurrency for afb_msg_json_reply_error

Change-Id: I37ab68217c733456810e7e9ceb4e2e6c058f1b5b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoHandles subcall sync within xreq
José Bollo [Wed, 24 May 2017 14:56:26 +0000 (16:56 +0200)]
Handles subcall sync within xreq

Change-Id: Ieac7c589ddadfb67761332443a3fd92038b6d548
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBindings V2: migration of HelloWorld binder
José Bollo [Mon, 22 May 2017 14:50:52 +0000 (16:50 +0200)]
Bindings V2: migration of HelloWorld binder

Change-Id: I34df971e9182fbab13d590e8390d6fe6af5d0f51
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBindings V2: Remove explicit references to daemon/service
José Bollo [Mon, 22 May 2017 14:37:28 +0000 (16:37 +0200)]
Bindings V2: Remove explicit references to daemon/service

Usage shown that managing daemon interface and service
interface wasn't obvious. This evolution hides the complexity
by setting up an internal hidden variable.

Change-Id: I667b1ee4e3a7b5ad29d712ee20ad5dd1878b97f3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd json2c for including json in C files
José Bollo [Fri, 19 May 2017 10:07:44 +0000 (12:07 +0200)]
Add json2c for including json in C files

Change-Id: I08d8f1c249d5612831fcbc66fe5d0caee4e3a73d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBindings V2: rename init functions
José Bollo [Fri, 19 May 2017 10:05:29 +0000 (12:05 +0200)]
Bindings V2: rename init functions

The new naming is closer to the functionnal design
and closer to V1 names.

Change-Id: I8970338056a30564b84eaa1a7da6df3a9e6aa579
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agobindings v2: Enforce to explicitely ask for concurrency
José Bollo [Fri, 19 May 2017 09:12:06 +0000 (11:12 +0200)]
bindings v2: Enforce to explicitely ask for concurrency

Change-Id: Ic20d1eb1c8515cd86444ad62b0daacbcd75e9b7e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBindings V2: Refactor session flags
José Bollo [Fri, 19 May 2017 08:42:21 +0000 (10:42 +0200)]
Bindings V2: Refactor session flags

Change-Id: Idb104b3db69d785b11446fe9b66084839290362f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix cmake dependency 25/9425/1 3.99.1 dab/3.99.1 dab_3.99.1
Ronan Le Martret [Fri, 19 May 2017 14:58:14 +0000 (16:58 +0200)]
Fix cmake dependency

 * update documentation (get libmicrohttpd>=0.9.54 from upstream).

Change-Id: I361708fecd3b670dba0f32230fa3bcbd86fa9c55
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoFix a bug in subscribers counting
José Bollo [Thu, 18 May 2017 14:57:12 +0000 (16:57 +0200)]
Fix a bug in subscribers counting

To avoid as much as possible allocation/deallocation
when possible sequences of subscribe/unsubscribe are
encountered, the watch strucutre of events is destroyed
only when either the event or the client is destroyed.

This commit fixes a bad handling in the count of
active subscribers.

Change-Id: I3f240e69c3b21356ff07f584fe9bfb578d46732b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoFix the timer signal number
José Bollo [Mon, 15 May 2017 09:50:44 +0000 (11:50 +0200)]
Fix the timer signal number

Change-Id: I2dc7520f41472afefc31be7d3ac1a205611c1828
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofree SIGALRM for boost timers
José Bollo [Fri, 12 May 2017 15:49:19 +0000 (17:49 +0200)]
free SIGALRM for boost timers

Change-Id: Ib6825c21b6589db6c7e9b8c5a179c347bcc0a93d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agogenerate skeleton from OpenAPI 3
José Bollo [Wed, 10 May 2017 17:33:14 +0000 (19:33 +0200)]
generate skeleton from OpenAPI 3

Change-Id: Ia2c9d42a12e9b425d34a3a70ae255d82a9320e8c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoimprove log
José Bollo [Wed, 10 May 2017 17:32:55 +0000 (19:32 +0200)]
improve log

Change-Id: I218356c3122179887e8be885affb82cdc6403dbf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoCompiles for cynara if present
José Bollo [Wed, 10 May 2017 17:32:18 +0000 (19:32 +0200)]
Compiles for cynara if present

Change-Id: If8ef53f8a0a57bf6d19b0da3d13a7794a8d0eef9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoimplement authorisation check
José Bollo [Fri, 5 May 2017 17:22:55 +0000 (19:22 +0200)]
implement authorisation check

Change-Id: I2ef74b715a115acd11fa13744ba921e875f0bc65
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agorefactor hsrv using jobs queue
José Bollo [Fri, 5 May 2017 17:11:40 +0000 (19:11 +0200)]
refactor hsrv using jobs queue

Change-Id: I3d0c70efc2053340fcec93695006e01bb6b49e2c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoremove afb-perm compiler
José Bollo [Fri, 5 May 2017 17:09:26 +0000 (19:09 +0200)]
remove afb-perm compiler

Change-Id: Ib35f33440ae7fafe72870ad437d39508aec7894e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd default cred to HTTP link
José Bollo [Fri, 5 May 2017 17:04:43 +0000 (19:04 +0200)]
Add default cred to HTTP link

Change-Id: Ibb73cebc99094b33b61820482327296049c2026a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd user to context
José Bollo [Fri, 5 May 2017 16:59:57 +0000 (18:59 +0200)]
Add user to context

At this time, user is the string representation
of the uid.

Change-Id: I65fbb4112f209fdb948d24e9c47fa73dacdf571f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoExpose session UUID from context
José Bollo [Fri, 5 May 2017 16:57:04 +0000 (18:57 +0200)]
Expose session UUID from context

Change-Id: Ifcf08e840b4ac92889874700c630495b6dfc3e66
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoImprove includes
José Bollo [Fri, 5 May 2017 10:59:09 +0000 (12:59 +0200)]
Improve includes

Change-Id: I87278ce38270782e74bd29a7920fe6a6e63eea0d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomake function afb_context_set return a status
José Bollo [Fri, 5 May 2017 10:26:13 +0000 (12:26 +0200)]
make function afb_context_set return a status

Change-Id: I5172c58288e5974001f3478f7cee94d7a98abe7d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoChange the effect of close session
José Bollo [Fri, 5 May 2017 10:18:59 +0000 (12:18 +0200)]
Change the effect of close session

Using the flag AFB_SESSION_CLOSE now has effect only
on the requesting binding.

Before, all the session was closed. This could lead
to unexpected conflicts.

Change-Id: Ic945e8d164a8558eae05d169b0c5f372b036cf36
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosession: start to manage concurrency
José Bollo [Fri, 5 May 2017 10:04:25 +0000 (12:04 +0200)]
session: start to manage concurrency

Change-Id: I5895fa14fcb496e71fba600994e7e454cf1d110b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoMake LOA local to the binding
José Bollo [Thu, 4 May 2017 16:01:29 +0000 (18:01 +0200)]
Make LOA local to the binding

Change-Id: If0494a19a4ce2865af699491c1f6d7b73bce8f11
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix a warning
José Bollo [Thu, 4 May 2017 15:07:39 +0000 (17:07 +0200)]
fix a warning

Change-Id: Iaebb861a56a490decdca0eada52e26b902457d1d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoadd function to get the current LOA
José Bollo [Thu, 4 May 2017 15:04:39 +0000 (17:04 +0200)]
add function to get the current LOA

Change-Id: I0f2a0eae8b4de982549fa4a87e2e0f8150c7d6cc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoPrepare permission for binding version 2
José Bollo [Thu, 4 May 2017 14:45:54 +0000 (16:45 +0200)]
Prepare permission for binding version 2

Change-Id: I38c1291b3c11a9b436d00ef6dab4f7efb86e4996
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoPrepare bindings version 2
José Bollo [Thu, 4 May 2017 14:21:18 +0000 (16:21 +0200)]
Prepare bindings version 2

Change-Id: Ic9e417d9a36f5da08883c3ded127d8350ff893cc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoPrepare xreq to be aware of the version
José Bollo [Thu, 4 May 2017 11:06:02 +0000 (13:06 +0200)]
Prepare xreq to be aware of the version

Change-Id: If8a1ac53e58ff644d7903aebd263d7d42308c756
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoEliminate use of AFB_SESSION_CREATE
José Bollo [Thu, 4 May 2017 09:55:35 +0000 (11:55 +0200)]
Eliminate use of AFB_SESSION_CREATE

AFB_SESSION_CREATE is obsolete since a while.

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