src/app-framework-binder.git
6 years agomonitor-base.css: fix overflow
José Bollo [Tue, 29 Aug 2017 16:14:23 +0000 (18:14 +0200)]
monitor-base.css: fix overflow

Change-Id: I075be34d5f29c12c3306d16b3c14ccd40b9a98ff
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agohooking: Add hook at global scope
José Bollo [Tue, 29 Aug 2017 15:58:08 +0000 (17:58 +0200)]
hooking: Add hook at global scope

Actually the global scope only allows to trace
log messages.

Change-Id: Ib73edf2e3168311b2ad694d857e6647e34884313
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoverbosity: split verbosity level 1 in 2 levels
José Bollo [Tue, 29 Aug 2017 14:28:17 +0000 (16:28 +0200)]
verbosity: split verbosity level 1 in 2 levels

Change-Id: I32a96f1863caffa6a17c25f52d06538f8eb60555
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoverbosity: Prepare hooking of log messages
José Bollo [Tue, 29 Aug 2017 14:25:44 +0000 (16:25 +0200)]
verbosity: Prepare hooking of log messages

Change-Id: Icfe96d2fee2d3b699dfa9105fcfe62d4eced2557
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomain: set name even for syslog
José Bollo [Tue, 29 Aug 2017 13:50:12 +0000 (15:50 +0200)]
main: set name even for syslog

Change-Id: I67d74cc2d539651101e82b17d50c8afb8dde621a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agohook+trace: add a unique timestamp
José Bollo [Tue, 29 Aug 2017 12:51:22 +0000 (14:51 +0200)]
hook+trace: add a unique timestamp

A same event must have a unique time stamp.

Change-Id: Id33351a97f62c04a84d26995a2cf9ae80613c613
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agohook+trace: adds hookid and type
José Bollo [Tue, 29 Aug 2017 12:18:47 +0000 (14:18 +0200)]
hook+trace: adds hookid and type

The hookid is a unic identifier for a hook event.
Its purpose is to distinguish events that could match
different filters: a same event has a same id.

Also integrate the field "type" (of the event) in the
trace event.

Change-Id: I90b0b2d3a0846b673b993110d2752cc54db75bd8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config Copies the values of option --exec
José Bollo [Tue, 29 Aug 2017 12:09:22 +0000 (14:09 +0200)]
afb-config Copies the values of option --exec

Not copying is not possible if the name
of the process is changed.

Change-Id: I52122c84234ac275975dae47c23c9d7240b82df8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoprocess-name: fix a warning
José Bollo [Tue, 29 Aug 2017 11:08:00 +0000 (13:08 +0200)]
process-name: fix a warning

Change-Id: I1e70cded34b080215b53b8bb28945303d4e5f3e6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd option --name for naming the process
José Bollo [Tue, 29 Aug 2017 09:22:49 +0000 (11:22 +0200)]
Add option --name for naming the process

This option allows to set the command line
and the thread name of the main process.

The value can contain spaces that will be
replaced by nulls.

Change-Id: I895270a24663467b16fb3cd8fc3218b7b003b6bb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: update the output of the config
José Bollo [Tue, 29 Aug 2017 09:17:02 +0000 (11:17 +0200)]
afb-config: update the output of the config

Change-Id: I1dbc3c0b0c84cb34da1c8851044a6e72e4dfbd34
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRework CMakeList.txt
José Bollo [Tue, 29 Aug 2017 08:25:50 +0000 (10:25 +0200)]
Rework CMakeList.txt

Explicit options and add a definition for AGL_DEVEL

Change-Id: I8419f0b0dfecc1e0171c282573cdf32ae3f09704
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMerge "Update packaging"
José Bollo [Tue, 29 Aug 2017 06:33:22 +0000 (06:33 +0000)]
Merge "Update packaging"

6 years agobuild config: remove forced AGL_DEVEL from src/CMakelists.txt
Stephane Desneux [Mon, 28 Aug 2017 12:50:26 +0000 (14:50 +0200)]
build config: remove forced AGL_DEVEL from src/CMakelists.txt

Change-Id: I6fd44469b148732103d4b903f94c355f2bd231ee
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
6 years agomonitor: disable monitoring by default
Stephane Desneux [Mon, 28 Aug 2017 12:47:55 +0000 (14:47 +0200)]
monitor: disable monitoring by default

Change-Id: I8e76e9c184dd913a5040578366c8783ac4b3efaa
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
6 years agofix typo
Stephane Desneux [Mon, 28 Aug 2017 12:44:12 +0000 (14:44 +0200)]
fix typo

Change-Id: Ifb2de3c13f814f16f23ead9357f4fec97b3e675c
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
6 years agoUpdate packaging 05/10705/1
Ronan Le Martret [Mon, 28 Aug 2017 09:50:18 +0000 (11:50 +0200)]
Update packaging

 * add libmicrohttpd dependency for deb packaging
 * add monitoring packaging to spec file

Change-Id: I228907183640f4edda9bcc3ca634043d5e22e811
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agomonitoring: add default page index.html
José Bollo [Sun, 27 Aug 2017 12:52:57 +0000 (14:52 +0200)]
monitoring: add default page index.html

This allows to acces monitoring interface using
url HOST/monitoring/ when option --monitoring is set.

Change-Id: If7dfc89e4c4db0d87ec5c8e74f9243691a3ec0e8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: rework on option --random-token
José Bollo [Sun, 27 Aug 2017 12:50:43 +0000 (14:50 +0200)]
afb-config: rework on option --random-token

When set, this option will enforce a random
token in any cases.

Not using the option --token has the same effect
asking for a random token.

So the option now serves to enforce a random token.

Change-Id: Iea2cee44b95d5479c36217d312ab6e8ce6726005
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitoring: Add option --monitoring
José Bollo [Sun, 27 Aug 2017 12:48:05 +0000 (14:48 +0200)]
monitoring: Add option --monitoring

Installs basic interface for monitoring and
add the option --monitoring / -M to activate
the alias /monitoring. This makes the page
/monitoring/monitor.html available.

Change-Id: Iebe0959f0a5e7c396fe7ce6862d0f9c883733824
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Add short -p option for --port
José Bollo [Sun, 27 Aug 2017 12:44:17 +0000 (14:44 +0200)]
afb-config: Add short -p option for --port

Change-Id: Iae8475559ee2381ee7d687c6afc2e6ce7145ebf3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitoring: improvements
José Bollo [Sun, 27 Aug 2017 11:35:37 +0000 (13:35 +0200)]
monitoring: improvements

- use flex/css for correct layout
- handles disconnection nicely
- handles initial token
- fix typo in afb-api-so

Change-Id: I386b98f9d6a2182029d39a373a9820478f97cfa6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosrc/afb-api-so.c: fix uninitialized variable
Stephane Desneux [Sat, 26 Aug 2017 15:23:50 +0000 (17:23 +0200)]
src/afb-api-so.c: fix uninitialized variable

Change-Id: If7f576e8f4bdc613d836c158df6e5f0bbfea87b7
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
6 years agomonitoring: add copyrights
José Bollo [Sat, 26 Aug 2017 06:01:49 +0000 (08:01 +0200)]
monitoring: add copyrights

Also still improve colours

Change-Id: I2afc2dc7bf22ef65e39c18c9397ae6c7cd2df1d4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitoring: fix color
José Bollo [Sat, 26 Aug 2017 05:47:48 +0000 (07:47 +0200)]
monitoring: fix color

Change-Id: I73481b5a7d509c7f6640fc8b0c21c502667a657e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: copy string values
José Bollo [Fri, 25 Aug 2017 15:10:17 +0000 (17:10 +0200)]
afb-config: copy string values

Change-Id: Ibbc5924adef104d9ec7399e7943baa1d799d2572
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Improve naming (cosmetic)
José Bollo [Fri, 25 Aug 2017 15:01:40 +0000 (17:01 +0200)]
afb-config: Improve naming (cosmetic)

Change-Id: Ib3133cbcd458fbd1ca1ee5aac64700c9ebc83b60
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Optimize boolean flags
José Bollo [Fri, 25 Aug 2017 12:21:38 +0000 (14:21 +0200)]
afb-config: Optimize boolean flags

Change-Id: I476cb5c7cd873802273f243eb3454857c8723e96
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd option --no-ldpaths to avoid default ldpaths
José Bollo [Fri, 25 Aug 2017 11:19:32 +0000 (13:19 +0200)]
Add option --no-ldpaths to avoid default ldpaths

Instead of writing --ldpaths=/dev/null simply use
the option --no-ldpaths

Change-Id: Ia278989b90a079d998ba0cbb7a6bb78c46d58090
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd option --weak-ldpaths (for weak loading path)
José Bollo [Fri, 25 Aug 2017 11:09:13 +0000 (13:09 +0200)]
Add option --weak-ldpaths (for weak loading path)

This option allows to specify a loading path where
binding that fails on load are ignored.

Change-Id: Ie0646f88ba9207dd117737a8b251a7a42f424f02
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-so: fix a bug in error detection
José Bollo [Fri, 25 Aug 2017 10:50:57 +0000 (12:50 +0200)]
afb-api-so: fix a bug in error detection

Error detection wasn't reported when an
error occured in a subdirectory.

Also closes the opened directories on error
and allows a mode for ignoring binding errors.

Change-Id: I34e52de8ea71bf84556878a395b56c6628cc5d9a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitoring: improve user interface
José Bollo [Fri, 25 Aug 2017 08:45:03 +0000 (10:45 +0200)]
monitoring: improve user interface

- fix buttons
- manage scrolling
- added separators

Change-Id: I327a74d004ec33c41bb5e0dbc913bb02d9848878
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitoring: updated demo with dark theme
José Bollo [Thu, 24 Aug 2017 22:22:43 +0000 (00:22 +0200)]
monitoring: updated demo with dark theme

Change-Id: Ibb77655cd614553bf0090bf5ffa64180d1279f8b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitor: Test page for monitoring
José Bollo [Tue, 22 Aug 2017 07:21:43 +0000 (09:21 +0200)]
monitor: Test page for monitoring

This is a test page for showing basic monitoring
use.

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-monitor: update hooks for tracing
José Bollo [Thu, 24 Aug 2017 08:22:43 +0000 (10:22 +0200)]
afb-monitor: update hooks for tracing

Updating hooks is needed (at the moment) also for events.

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