1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="https://gerrit.automotivelinux.org/gerrit/" name="agl" pushurl="ssh://gerrit.automotivelinux.org:29418" review="https://gerrit.automotivelinux.org/gerrit/"/>
<remote fetch="https://github.com/" name="github"/>
<remote fetch="git://git.openembedded.org/" name="openembedded"/>
<remote fetch="git://code.qt.io/" name="qt.io"/>
<remote fetch="git://git.yoctoproject.org/" name="yocto"/>
<default remote="agl" revision="refs/tags/flounder/5.99.6" sync-j="4"/>
<project name="01org/meta-security-isafw" path="meta-security-isafw" remote="github" revision="489abdc65cefb566d696c8b218aa0b9b99a350ae" upstream="master"/>
<project name="AGL/meta-agl" path="meta-agl"/>
<project name="AGL/meta-agl-demo" path="meta-agl-demo"/>
<project name="AGL/meta-agl-devel" path="meta-agl-devel"/>
<project name="AGL/meta-agl-extra" path="meta-agl-extra"/>
<project name="AGL/meta-renesas-rcar-gen3" path="meta-renesas-rcar-gen3"/>
<project name="CogentEmbedded/meta-rcar" path="meta-rcar" remote="github" revision="a0551596548ef3a4c9132161f3d9c4ae538d6fdc" upstream="v3.7.0"/>
<project name="advancedtelematic/meta-updater" path="meta-updater" remote="github" revision="ff555e8690eb47177ade42dc6912ae17a759cc45" upstream="rocko"/>
<project name="advancedtelematic/meta-updater-qemux86-64" path="meta-updater-qemux86-64" remote="github" revision="697632ddd98ed7ae3dbd0bd84abb04079767bc56" upstream="rocko"/>
<project name="boundarydevices/meta-boundary" path="meta-boundary" remote="github" revision="f96f41b2e5beda2b51acb702d082568898b36a68" upstream="rocko"/>
<project name="kraj/meta-altera" path=Migration to binding V3
=======================
The ***binding*** interface evolved from version 1 to version 2
for the following reasons:
- integration of the security requirements within the bindings
- simplification of the API (after developer feedbacks)
- removal of obscure features and cleanup
The ***binder*** can run ***bindings*** v1, v2 and/or v3 in any combination.
Thus moving from v1 or v2 to v3 is not enforced at this time. But ...
In the face to face meeting in Karlsruhe it was decided to remove support
of bindings v1 and to deprecate the use of bindings v2.
So at the end, **IT IS HIGHLY NEEDED TO SWITCH TO VERSION 3**
This guide covers the migration of bindings from version 2 to version 3.
The migration from version 1 is not treated here because bindings version 1
are very old and probably do not exist anymore. If needed you can refer
to the old [guide to migrate bindings from v1 to v2](legacy/afb-migration-v1-to-v2.html).
Differences between version 2 and version 3
-------------------------------------------
### in v3 all is api
The version 3 introduces the concept of "API" that gather what was called before
the daemon and the service. This is the new concept that predates the 2 others.
The concept of API is intended to allow the definition of multiple APIs
by a same "binding" (a dynamically loaded library).
Because there is potentially several "API", the functions that were without
context in bindings version 2 need now to tell what API is consumer.
To be compatible with version 2, bindings v3 still have a default hidden
context: the default API named **afbBindingV3root**.
To summarize, the functions of class **daemon** and **service** use the default
hidden API.
It is encouraged to avoid use of functions of class **daemon** and **service**.
You should replace these implicit calls to explicit **api** calls that
reference **afbBindingV3root**.
Same thing for the logging macros: **AFB_ERROR**, **AFB_WARNING**,
**AFB_NOTICE**, **AFB_INFO**, **AFB_DEBUG** that becomes respectively
**AFB_API_ERROR**, **AFB_API_WARNING**, **AFB_API_NOTICE**, **AFB_API_INFO**,
**AFB_API_DEBUG**.
Example of 2 equivalent writes:
```C
AFB_NOTICE("send stress event");
afb_daemon_broadcast_event(stressed_event, NULL);
```
or
```C
AFB_API_NOTICE(afbBindingV3root, "send stress event");
afb_api_broadcast_event(afbBindingV3root, stressed_event, NULL);
```
### the reply mechanism predates success and fail
### subcall has more power
Task list for the migration
---------------------------
This task list is:
1. Use the automatic migration procedure described below
2. Adapt the functions **preinit**, **init** and **onevent**
3. Consider use of the new reply
4. Consider use of the new (sub)call
5. Consider use of event handlers
The remaining chapters explain these task with more details.
Automatic migration!
--------------------
A tiny **sed** script is intended to perform a first pass on the code that
you want to upgrade. It can be done using **curl** and applied using **sed**
as below.
```bash
BASE=https://git.automotivelinux.org/src/app-framework-binder/plain
SED=migration-to-binding-v3.sed
curl -o $SED $BASE/docs/$SED
sed -i -f $SED file1 file2 file3...
```
You can also follow
[this link](https://git.automotivelinux.org/src/app-framework-binder/plain/docs/migration-to-binding-v3.sed)
and save the file.
This automatic action does most of the boring job but not all the job.
The remaining of this guide explains the missing part.
Adapt the functions preinit, init and onevent
----------------------------------------------
The signature of the functions **preinit**, **init** and **onevent** changed
to include the target api.
The functions of the v2:
```C
int (*preinit)();
int (*
|