src/app-framework-binder.git
6 years agoafb-session: Insert call to hooking
José Bollo [Mon, 12 Feb 2018 08:12:47 +0000 (09:12 +0100)]
afb-session: Insert call to hooking

Change-Id: I7d91b133761c7c751300bf1344321e295cce1bc3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Add hooks for session
José Bollo [Wed, 7 Feb 2018 16:45:37 +0000 (17:45 +0100)]
afb-hook: Add hooks for session

Change-Id: I4fbd6bf57958abb366a742b12afb92bfc03ad299

6 years agoafb-session: Refactor and test unit
José Bollo [Wed, 7 Feb 2018 16:44:20 +0000 (17:44 +0100)]
afb-session: Refactor and test unit

The session are refactored and now to include a test unit.

Change-Id: Ia8c4b707191f3af95c0549b333d14b384a81eaa7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Fix a session leak bug
José Bollo [Wed, 7 Feb 2018 11:38:20 +0000 (12:38 +0100)]
afb-stub-ws: Fix a session leak bug

Change-Id: I55b72d7a4e7ca18e61addb3b0efa2ec75729060b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Improve doc of option --token
José Bollo [Wed, 7 Feb 2018 10:30:08 +0000 (11:30 +0100)]
afb-config: Improve doc of option --token

Change-Id: I196c7f2b216e031f52b208e19c6c2df8593d27c5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomain: Isolate HTTP initialization
José Bollo [Wed, 7 Feb 2018 10:27:52 +0000 (11:27 +0100)]
main: Isolate HTTP initialization

Initializations linked to HTTP are deferred
until starting the HTTP server.

Change-Id: I917c4c5db3c3ae894ee60fd16b9e09d4185fcdb4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Return an initialization status
José Bollo [Wed, 7 Feb 2018 10:25:37 +0000 (11:25 +0100)]
afb-session: Return an initialization status

Avoid exiting anywhere

Change-Id: Ic24a2c7435645632d609fb16849d33b204062397
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Fix a typo
José Bollo [Wed, 7 Feb 2018 08:31:29 +0000 (09:31 +0100)]
afb-session: Fix a typo

Change-Id: Ia834cfd203ab1471efa21ce650fcd7895370dc63
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Add argument to start
José Bollo [Tue, 6 Feb 2018 15:19:17 +0000 (16:19 +0100)]
jobs: Add argument to start

Change-Id: I89a75a036c60097fb898ab8723007ca6ebfc7f39
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-xreq: Export afb_request facilities
José Bollo [Tue, 6 Feb 2018 10:29:32 +0000 (11:29 +0100)]
afb-xreq: Export afb_request facilities

Internally, the binder can need to convert
afb_request to xreq and conversely.
Exporting this facilities is good.

Change-Id: I5bb01d701eee0ac30ad6ce490609f6124a9d5860
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: Replace daemon by api name
José Bollo [Wed, 31 Jan 2018 16:16:18 +0000 (17:16 +0100)]
afb-trace: Replace daemon by api name

This replacement greatly improves the code.

Change-Id: If3fd6e6080eda2268ccf551998f99af01799be29
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-evt: Add event creation with prefix
José Bollo [Wed, 31 Jan 2018 16:15:27 +0000 (17:15 +0100)]
afb-evt: Add event creation with prefix

Change-Id: I2fd35e8ed59c28f4283be698a2586cdae5f7c8cf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api: Enforce api names to be hookable
José Bollo [Wed, 31 Jan 2018 13:52:08 +0000 (14:52 +0100)]
afb-api: Enforce api names to be hookable

Change-Id: Ic1d5cb208c636d3261e1a96c4a81b488cb84a60e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Allow to unhook some apis
José Bollo [Fri, 11 Aug 2017 15:00:08 +0000 (17:00 +0200)]
afb-hook: Allow to unhook some apis

The apis starting with a $ (dollar) will not be
tracked by hooks

Change-Id: I3b83458c288ef1eb27993d4c71785b32e5a72deb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Integrate systemd watchdog by default
José Bollo [Thu, 18 Jan 2018 10:17:25 +0000 (11:17 +0100)]
jobs: Integrate systemd watchdog by default

Change-Id: Iaa3ce3ee9188e3ddaf6ee70964963d29df78689f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Split jobs_get_sd_event
José Bollo [Thu, 18 Jan 2018 10:16:57 +0000 (11:16 +0100)]
jobs: Split jobs_get_sd_event

Provide a mutex locked internal function for getting
the event loop: get_sd_event_locked

Change-Id: I2635f901b3ec0fcf2c52f569f4c57cfd046601af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-common: Cleanup
José Bollo [Thu, 18 Jan 2018 09:50:41 +0000 (10:50 +0100)]
afb-common: Cleanup

Change-Id: Ifc5adbdc92c3d034c92dd432c72057f3267c4964
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Dichotomic mimetype search
José Bollo [Thu, 18 Jan 2018 09:44:24 +0000 (10:44 +0100)]
afb-hreq: Dichotomic mimetype search

Change-Id: I6d906c31cdcf07c5404f1eb81cd44683976465f7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Sort mimetypes
José Bollo [Thu, 18 Jan 2018 09:16:13 +0000 (10:16 +0100)]
afb-hreq: Sort mimetypes

Change-Id: I45ae5a702b83dabe081b625b4bcaf5de33ffa1e6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Add json to known mimetypes
Loïc Collignon [Thu, 30 Nov 2017 10:47:15 +0000 (11:47 +0100)]
afb-hreq: Add json to known mimetypes

Change-Id: Ic11ebf7e569160dd25e66a1273904dfcd82bdeb8
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
6 years agoafb-client-demo: Fix memory leak
José Bollo [Fri, 5 Jan 2018 16:02:19 +0000 (17:02 +0100)]
afb-client-demo: Fix memory leak

Change-Id: I636b95459715f3b272509eb76e304a49593fb527
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-so: Exclude directories starting with .
José Bollo [Fri, 5 Jan 2018 15:33:20 +0000 (16:33 +0100)]
afb-api-so: Exclude directories starting with .

Exclude from the search of bindings any
directory starting with a dot (.) by default.

It is possible to reactivate the prvious behaviour
by defining the following preprocessor variables

 - AFB_API_SO_ACCEPT_DOT_PREFIXED_DIRS

   When this variable is defined, the directories
   starting with a dot are searched except
   if their name is "." or ".." or ".debug"

 - AFB_API_SO_ACCEPT_DOT_DEBUG_DIRS

   When this variable is defined and the variable
   AFB_API_SO_ACCEPT_DOT_PREFIXED_DIRS is also defined
   scans any directory not being "." or "..".

The previous behaviour was like difining the 2 variables,
meaning that only . and .. were excluded from the search.

This change is intended to definitely solve the issue
SPEC-662. Yocto installed the debugging symbols in the
subdirectory .debug. For example the binding.so also
had a .debug/binding.so file attached. Opening that
debug file made dlopen crashing.
See https://sourceware.org/bugzilla/show_bug.cgi?id=22101

Bug-AGL: SPEC-662

Change-Id: Ic38a83aaa5f16d938e504aba66597bb9a219c193
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-binding.hpp: Fix constexpr of 'binding'
José Bollo [Tue, 2 Jan 2018 12:28:42 +0000 (13:28 +0100)]
afb-binding.hpp: Fix constexpr of 'binding'

Change-Id: Icdee4029f11dcb6c0f75e945e0b411ea63654afe
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agogenskel: Add afb:: namespace prefix
José Bollo [Thu, 21 Dec 2017 15:56:31 +0000 (16:56 +0100)]
genskel: Add afb:: namespace prefix

Change-Id: I0cd2d09f97fac7a1976d2bfcd5ab616472bf970a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agogenskel: Add option for C++ output
José Bollo [Thu, 21 Dec 2017 13:26:57 +0000 (14:26 +0100)]
genskel: Add option for C++ output

The option --cpp or -x tell to produce a C++ output
that uses the 'constexpr' c++ feature.

Change-Id: I4eda4d21260573acbb01057ed95476bd4fc7ebe5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosig-monitor: Handle signals in exit
José Bollo [Thu, 21 Dec 2017 11:36:16 +0000 (12:36 +0100)]
sig-monitor: Handle signals in exit

Change signal treatment when exit is called
internally by sig-monitor.

Change-Id: Ieb6261b2143811d7abcbc49b134e919c8c5626dc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosig-monitor: Make signal list global
José Bollo [Thu, 21 Dec 2017 11:33:32 +0000 (12:33 +0100)]
sig-monitor: Make signal list global

Change-Id: I456a08dccf65d1a188e7bb7e0a6ab905ae823a25
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Add predefined mime-types
José Bollo [Mon, 18 Dec 2017 13:24:34 +0000 (14:24 +0100)]
afb-hreq: Add predefined mime-types

Add mimetypes for common extensions for conformance to
https://www.w3.org/TR/widgets/#rule-for-identifying-the-media-type-of-a-file

Change-Id: I3ae51afbbc2916b7237e4fa546392ec7ec5ea42a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-ws: Make weak ws-client by default (to be fixed)
José Bollo [Tue, 5 Dec 2017 16:29:24 +0000 (17:29 +0100)]
afb-api-ws: Make weak ws-client by default (to be fixed)

The case of unicens service that can be here or not creates
problem to the binding 4a when the service is not here.
This commits makes the requirement of ws-client
socket optional. This unblocks the situation but need to
be fixed later.

Bug-AGL: SPEC-1151

Change-Id: I569fa781c003492a4c6a7ad84c5b140ecdb05b65
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRemove unused and confusing files
José Bollo [Mon, 4 Dec 2017 16:19:12 +0000 (17:19 +0100)]
Remove unused and confusing files

Change-Id: I8362d8d7bf0f11a41ef2275614e9ef2bcf0fee29
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Fix locks in event loops
José Bollo [Fri, 1 Dec 2017 11:32:07 +0000 (12:32 +0100)]
jobs: Fix locks in event loops

Change-Id: Ie07a9bc4f930a0ecd2102a94e7f5f7b0daa705ef
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Fix possible race condition
José Bollo [Thu, 30 Nov 2017 06:17:31 +0000 (07:17 +0100)]
jobs: Fix possible race condition

Sending the signal while not being sure that is is
expected could be a race condition. Taking the mutex
avoids it.

In the same time, switch to broadcasting.

Change-Id: I3f43d0d860cccc61ec140ceef223f572f806872c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Check environment variables
José Bollo [Wed, 29 Nov 2017 17:13:58 +0000 (18:13 +0100)]
afb-config: Check environment variables

The following environment variables allows several
setting by the environment:

 * AFB_TRACEREQ, AFB_TRACEDITF, AFB_TRACESVC, AFB_TRACEEVT

    These variables allows setting of options --tracereq,
    --traceditf, --tracesvc, --traceevt

 * AFB_LDPATHS

    Set the option --ldpaths

Change-Id: I22700c658ce3fa1ceb15eab8f67adaaf41627b8f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: rewrite of the event loop handling
José Bollo [Wed, 29 Nov 2017 17:02:23 +0000 (18:02 +0100)]
jobs: rewrite of the event loop handling

This new version use an eventfd to unlock the
event loop when needed. This reduce the count
of sd_event needed.

Bug-AGL: SPEC-1091

Change-Id: I9bc273e89ab1a70ccc2187c2571e68c9c771ee25
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-ws & websocket: Fix writing very long data
José Bollo [Tue, 28 Nov 2017 10:13:27 +0000 (11:13 +0100)]
afb-ws & websocket: Fix writing very long data

This version loops to write very long data on
websockets.

Bug-AGL: SPEC-1091

Change-Id: I8f17e75e4ef483be29fa8cae2c0af159783ec2c6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoCMAKE: refactor options 4.99.3 eel/4.99.3 eel_4.99.3
José Bollo [Mon, 20 Nov 2017 14:22:40 +0000 (15:22 +0100)]
CMAKE: refactor options

The option ALLOW_NO_BINDER is removed and the option
ONLY_DEVTOOLS is introduced.

Change-Id: Ia19eb977ee25a3871582605028fdef75e552363f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMerge "Fix build for native package"
José Bollo [Mon, 20 Nov 2017 14:00:08 +0000 (14:00 +0000)]
Merge "Fix build for native package"

6 years agoFix build for native package 51/12051/1
Ronan Le Martret [Mon, 20 Nov 2017 13:31:46 +0000 (14:31 +0100)]
Fix build for native package

 * If the package is natively compile, the gcc used is the
   host gcc, and host gcc version must be >4.9. This is unneeded
   for the mode ALLOW_NO_BINDER (like in native).

Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agofix build error
José Bollo [Fri, 17 Nov 2017 17:02:50 +0000 (18:02 +0100)]
fix build error

Change-Id: I6ff16055597d36290f50b40d6dfe960aea691652
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-proto-ws: Fix autolock in proto-ws
José Bollo [Fri, 17 Nov 2017 15:51:02 +0000 (16:51 +0100)]
afb-proto-ws: Fix autolock in proto-ws

Because a systemd event loop can not be reentered
while evaluating an event callback, the event loop
was removed from the threads. It had the effect to
enter in deadlock when calling a synchronous call
while in an event callback.

Queueing a job solves the issue.

But because using queued job has implications on
libafbws, a fake job manager is added for libafbws.

Change-Id: Id793bea55743790082eaab48cd4cc87f7993772a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoCMAKE: allow to compile afb-genskel only
José Bollo [Fri, 17 Nov 2017 10:10:43 +0000 (11:10 +0100)]
CMAKE: allow to compile afb-genskel only

When missing components are detected, allows to not compile
the binder if ALLOW_NO_BINDER is ON

Change-Id: I0fb27844e3f36d4dd643bdf250f05b4f6769bc53
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-export: Ensure monitoring of events
José Bollo [Mon, 13 Nov 2017 14:07:04 +0000 (15:07 +0100)]
afb-export: Ensure monitoring of events

Change-Id: Id82c624f695a229023447c16652bcc912b6d6fed
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitoring: Set default token to HELLO
José Bollo [Sat, 11 Nov 2017 23:56:17 +0000 (00:56 +0100)]
monitoring: Set default token to HELLO

Change-Id: I3c158598da70089b9646233c632f14f62f1baa15
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-proto-ws: fix self locking issue
José Bollo [Sat, 11 Nov 2017 21:36:05 +0000 (22:36 +0100)]
afb-proto-ws: fix self locking issue

Calling synchronously a verb on an event of the same
API was blocking.

Change-Id: I58a988c6df8c60cd3a38c3cdff23d7be8b6be54e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: autoclose session on disconnection
José Bollo [Tue, 7 Nov 2017 18:25:44 +0000 (19:25 +0100)]
afb-stub-ws: autoclose session on disconnection

Change-Id: If46ca2fa34a080b7087edb4e0da109c5ee85b14f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: manage closed sessions
José Bollo [Tue, 7 Nov 2017 18:25:15 +0000 (19:25 +0100)]
afb-stub-ws: manage closed sessions

Change-Id: I16620f12719c222c0da03caf330a865149fe9051
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: improve naming
José Bollo [Tue, 7 Nov 2017 16:21:37 +0000 (17:21 +0100)]
afb-session: improve naming

Change-Id: I6692f9089be355995d5caf979f4344ed3b8337a7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Track sessions for releasing it
José Bollo [Tue, 7 Nov 2017 12:54:23 +0000 (13:54 +0100)]
afb-stub-ws: Track sessions for releasing it

Change-Id: If0ff0f491e0fd8267137aa742d7acbe0157f88ad
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Improve readability
José Bollo [Mon, 6 Nov 2017 22:25:10 +0000 (23:25 +0100)]
afb-session: Improve readability

Change-Id: I4035a59d125e0768b0366c3dc5e7509e416ab9c6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: fix reference counting
José Bollo [Mon, 6 Nov 2017 22:01:42 +0000 (23:01 +0100)]
afb-session: fix reference counting

Change-Id: If36c9210f0982ba35299de52f0c8fd96e7c836e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: optimization
José Bollo [Mon, 6 Nov 2017 21:42:23 +0000 (22:42 +0100)]
afb-session: optimization

Change-Id: Ic3b0ec8e7bcbf21f7ae3a9f2b1a5719118a7912d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: add comments
José Bollo [Mon, 6 Nov 2017 17:01:58 +0000 (18:01 +0100)]
afb-session: add comments

Change-Id: I88026384d3f5e98659fba2bb774e41e931d45f51
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: remove unused access time
José Bollo [Mon, 6 Nov 2017 14:33:21 +0000 (15:33 +0100)]
afb-session: remove unused access time

Change-Id: I1e8ca2adfec5bf7df5a7da02e6d093ae099ec9a3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Add timeout features for sessions
José Bollo [Mon, 6 Nov 2017 14:31:34 +0000 (15:31 +0100)]
afb-session: Add timeout features for sessions

Change-Id: I0aa8a82c0bbf709aa380ef7e5efe2e4ebaf454c0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: add function afb_session_search
José Bollo [Mon, 6 Nov 2017 14:05:45 +0000 (15:05 +0100)]
afb-session: add function afb_session_search

Also the function afb_session_get always create
a session even if 'created' is NULL

Change-Id: Ia5ac1231e1d61e92cb9bbc07c968e3000d6864ff
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: improve and simplify session management
José Bollo [Mon, 6 Nov 2017 13:28:49 +0000 (14:28 +0100)]
afb-trace: improve and simplify session management

Change-Id: I828e0498bc68c9f1d1635a886e0a93fcb2d2389c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: improves comments and names
José Bollo [Mon, 6 Nov 2017 12:11:49 +0000 (13:11 +0100)]
afb-session: improves comments and names

Change-Id: I05850b05dc6747563ef38800821bfcaf5c45b5d0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: redefine the function 'afb_session_create'
José Bollo [Mon, 6 Nov 2017 12:10:55 +0000 (13:10 +0100)]
afb-session: redefine the function 'afb_session_create'

Change-Id: Ib8a66af30ea2438248adb66c9a95ac82663ec223
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAFB.js: make HELLO the default token
José Bollo [Mon, 6 Nov 2017 12:07:34 +0000 (13:07 +0100)]
AFB.js: make HELLO the default token

Change-Id: I76ae307672e1268b9cc4a9194e61f884a3f7455b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: rewrite of cookie handling
José Bollo [Mon, 6 Nov 2017 09:42:44 +0000 (10:42 +0100)]
afb-session: rewrite of cookie handling

Change-Id: I9852c1e2a211f79f25c7f32e9ac93acf7c5e6968
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd 'noconcurrency' when creating dynamic API 4.99.2 eel/4.99.2 eel_4.99.2
José Bollo [Fri, 3 Nov 2017 12:58:33 +0000 (13:58 +0100)]
Add 'noconcurrency' when creating dynamic API

Change-Id: Ia108b23b9480bb32f27127ef00c18086fcf86752
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-proto-ws: Fix unclosed file descriptor
José Bollo [Fri, 3 Nov 2017 12:26:49 +0000 (13:26 +0100)]
afb-proto-ws: Fix unclosed file descriptor

Change-Id: I3c831b4f803e283fc692fef66621a798a5e9296e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Improve event loop integration
José Bollo [Fri, 3 Nov 2017 12:04:30 +0000 (13:04 +0100)]
jobs: Improve event loop integration

The previous implmentation was buggy.

This changes make the event loop a thread global
variable. A thread now refuses to run an event loop
if it is in dispatching state.

Change-Id: Ic29792b87c1cae201958feb96d93678f6d37ac8d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoverbose: Ensure mutual exclusion when logging
José Bollo [Wed, 1 Nov 2017 12:32:44 +0000 (13:32 +0100)]
verbose: Ensure mutual exclusion when logging

Change-Id: I3ccc2ba35ee8db3d62eb229c736e65b2305184e3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agomonitoring: Improve readability of pastel style
José Bollo [Thu, 26 Oct 2017 10:14:07 +0000 (12:14 +0200)]
monitoring: Improve readability of pastel style

Change-Id: Ic2e8963ad9754b349064e535ed17fc768c0d8063
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAFB.js: Allows use of client's callIDs
José Bollo [Thu, 26 Oct 2017 10:13:21 +0000 (12:13 +0200)]
AFB.js: Allows use of client's callIDs

Change-Id: I4eaa768446abb875f9c030a58ff919b117c0bfe5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agowebsocket: Add function that explain error codes
José Bollo [Mon, 23 Oct 2017 12:12:08 +0000 (14:12 +0200)]
websocket: Add function that explain error codes

Change-Id: I500520edac6792013650fa3cb0e02d0b9f5610d5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agowebsocket: cleanup
José Bollo [Mon, 23 Oct 2017 12:11:32 +0000 (14:11 +0200)]
websocket: cleanup

Change-Id: I772e441f1b93131df670ef3fbef3a37e2a2c00f1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agowebsocket: Tune maximum received length
José Bollo [Mon, 23 Oct 2017 12:11:04 +0000 (14:11 +0200)]
websocket: Tune maximum received length

This commit increase the count of data that
is accepted by default from 65,000 to 1,048,500.

It also offers new functions to tune that value.

Change-Id: Iecf0b8c308e8287582819a8769859c39e46919c2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-api-dyn: Uniform return 0 on success
José Bollo [Mon, 16 Oct 2017 19:24:07 +0000 (21:24 +0200)]
afb-api-dyn: Uniform return 0 on success

Change-Id: I6ca079fa84547928f999e07d1925202a1e14850f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-api-so: improve error messages
José Bollo [Mon, 16 Oct 2017 14:53:26 +0000 (16:53 +0200)]
afb-api-so: improve error messages

Change-Id: I3bbf11890800a8b05c9cfaa8bd10b50a0b22c245
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-stub-ws: Always validate clients of stub-ws
José Bollo [Thu, 12 Oct 2017 20:59:09 +0000 (22:59 +0200)]
afb-stub-ws: Always validate clients of stub-ws

Change-Id: I2c020d586e6f22e47dac8ddb50c8ee9ca9c46b2e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agolibafbwsc: add function 'afb_ws_client_connect_api'
José Bollo [Wed, 11 Oct 2017 11:12:57 +0000 (13:12 +0200)]
libafbwsc: add function 'afb_ws_client_connect_api'

This function allows to connect to an API exported by the
binder.

The demo program afb-client-demo is modified to integrate
on option that direct API connection.

Example:
 server: afb-daemon --ws-server unix:hello
 client: afb-client-demo -d -H unix:hello

Change-Id: Id9f857a453c406df1c4b36eb25fb5e833a938c3d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-proto-ws: remove dependencies
José Bollo [Wed, 11 Oct 2017 11:11:06 +0000 (13:11 +0200)]
afb-proto-ws: remove dependencies

Remove dependencies to verbose and to afb-common.

Change-Id: I140f2cd7c159e9be994ab7b786a164d605d1b1dc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoUpdate documentation for afb_req_get_uid
José Bollo [Wed, 11 Oct 2017 08:26:07 +0000 (10:26 +0200)]
Update documentation for afb_req_get_uid

Change-Id: I984824b8ffc22783c1e6b63ee03ba23d5b7e2954
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoUpdate C++ interface for afb_req_get_uid
José Bollo [Wed, 11 Oct 2017 08:13:32 +0000 (10:13 +0200)]
Update C++ interface for afb_req_get_uid

Change-Id: I8c281417bd08b49ac708a7992cb46a074e74c979
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd the function afb_req_get_uid
José Bollo [Tue, 10 Oct 2017 16:21:54 +0000 (18:21 +0200)]
Add the function afb_req_get_uid

Change-Id: I9caf38ee3811cf10b546489094f0bb5b3d844c40
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRemove explicit Debug build type
José Bollo [Tue, 10 Oct 2017 16:21:23 +0000 (18:21 +0200)]
Remove explicit Debug build type

Change-Id: Ib9a793035b36ddf6f4c7cff2b814ba37bf662861
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-api-dbus: Make error for subcalls if DBUS transport
José Bollo [Mon, 9 Oct 2017 10:43:29 +0000 (12:43 +0200)]
afb-api-dbus: Make error for subcalls if DBUS transport

The DBUS API actually doesn't support the subcall feature.
Until the subcall is implemented, it is better to emit an error
than to fall back to the default behaviour (calling in the context
of the service).

Change-Id: Ibf5f3524995692a509d2d648d61e9ed0f874d7c1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd wrappers for accesses to internals
José Bollo [Fri, 22 Sep 2017 16:35:13 +0000 (18:35 +0200)]
Add wrappers for accesses to internals

Change-Id: I6144b0ab21418dc98792f0eeef695f3df0fc11d3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agocosmetic
José Bollo [Fri, 22 Sep 2017 15:13:14 +0000 (17:13 +0200)]
cosmetic

Change-Id: I628829b3a360897434a32b2fd0992f697f954f4d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd function afb_evt_eventid_addref
José Bollo [Fri, 22 Sep 2017 15:07:51 +0000 (17:07 +0200)]
Add function afb_evt_eventid_addref

Change-Id: I737f3ceaa41b5ec9a200a615dbc29965ed11c17c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoImprove naming of evt_eventids
José Bollo [Fri, 22 Sep 2017 15:04:22 +0000 (17:04 +0200)]
Improve naming of evt_eventids

Change-Id: I1fa3cf776110f67ad1b18c4c83f3a1707692ae8b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoCleanup of header files
José Bollo [Fri, 22 Sep 2017 14:31:15 +0000 (16:31 +0200)]
Cleanup of header files

Change-Id: Icf6cffdf303e125feec2661f5ce736a398c07932
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoProvide API and VERB name of requests
José Bollo [Fri, 22 Sep 2017 14:24:24 +0000 (16:24 +0200)]
Provide API and VERB name of requests

Change-Id: I9a86c6314f871334231e50f9cea60b54aed434b9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoProvide the name of the API
José Bollo [Fri, 22 Sep 2017 14:09:10 +0000 (16:09 +0200)]
Provide the name of the API

Change-Id: I5b4e4b40385830d1b8921d079f5e7e732ec4247f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd a closure argument to dynamic verbs
José Bollo [Fri, 22 Sep 2017 13:59:48 +0000 (15:59 +0200)]
Add a closure argument to dynamic verbs

Also demonstrate the mix of api v2 with dynapi.

Change-Id: I95e8d32ac836590ce3f7b3f0b5f29e5574808976
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAllow pure dynamic bindings
José Bollo [Fri, 22 Sep 2017 13:22:54 +0000 (15:22 +0200)]
Allow pure dynamic bindings

Activates the new internal interfaces

Change-Id: I8f51cd271f66a0216ffdf03626300bb5964a70f9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAllow dynamic creation of APIs
José Bollo [Fri, 22 Sep 2017 13:17:31 +0000 (15:17 +0200)]
Allow dynamic creation of APIs

Change-Id: I825bfa7969c98dd214457d9ff94e2948362286a9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoMake single afb_request_subcall
José Bollo [Fri, 22 Sep 2017 12:42:14 +0000 (14:42 +0200)]
Make single afb_request_subcall

Change-Id: I8cc96ef9c05781069f07b807bc6632d13668ac69
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-export: prepare to eventid
José Bollo [Fri, 22 Sep 2017 08:53:18 +0000 (10:53 +0200)]
afb-export: prepare to eventid

Change-Id: I87c09c2edb198598b3d303ceff07fcd6ec6a40f1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-export: cleanup of unused async
José Bollo [Fri, 22 Sep 2017 08:51:59 +0000 (10:51 +0200)]
afb-export: cleanup of unused async

Change-Id: I69e02e32444fe460219d849b26beb3db36ab5467
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agosig-monitor: Fix backtrace cropping
José Bollo [Fri, 22 Sep 2017 08:16:03 +0000 (10:16 +0200)]
sig-monitor: Fix backtrace cropping

Change-Id: Ia2e5fbbe62c7145c5934494d2cf04d04526cecef
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoProvide conversions for afb_event and afb_req
José Bollo [Fri, 22 Sep 2017 07:37:54 +0000 (09:37 +0200)]
Provide conversions for afb_event and afb_req

Provision is made here to convert, trivially:

 afb_event   ->   afb_eventid*
 afb_req     ->   afb_request*

The opposite conversions aren't provided to
favor new interfaces.

Change-Id: Ib67c2317f782e2edfd1ba0e49e10b321a3b770a3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRemove unused files
José Bollo [Fri, 22 Sep 2017 07:28:25 +0000 (09:28 +0200)]
Remove unused files

Change-Id: I922d69d8d2834a4aeebf06a925455ea7c28a1642
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoPrepare subscription to eventid
José Bollo [Fri, 22 Sep 2017 05:58:05 +0000 (07:58 +0200)]
Prepare subscription to eventid

Change-Id: Ie3f75377009be36f7f5bd52bdb31d0611cd49778
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoMake addref for request return the pointer
José Bollo [Fri, 22 Sep 2017 05:39:49 +0000 (07:39 +0200)]
Make addref for request return the pointer

Change-Id: I4286cbd9d02b406570185d265e7b925c43bbc42c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoDeprecate internal use of afb_event
José Bollo [Thu, 21 Sep 2017 19:25:07 +0000 (21:25 +0200)]
Deprecate internal use of afb_event

The deprecation is made in favor of
afb_eventid but this can change later
in favor of afb_evt_evtid.

Change-Id: Ic16cb25dbd97cb1e8d26b3c54b159d46bbf82671
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-export: record apiset at creation
José Bollo [Thu, 21 Sep 2017 16:17:39 +0000 (18:17 +0200)]
afb-export: record apiset at creation

Change-Id: I058eaee990e34990d0860a316ba8c348c23eff5f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-auth: Move json serialisation of afb_auth
José Bollo [Thu, 21 Sep 2017 15:02:36 +0000 (17:02 +0200)]
afb-auth: Move json serialisation of afb_auth

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