http://genivi.github.io/capicxx-dbus-tools/
D-bus를 위한 CommonAPI C++
CommonAPI C++ 은 내부 프로세스간 통신을 하기위한 C++ 프레임워크이다. high-level 의 C++ API 로 구성되어 있으며 D-Bus 와 같은 다양한 IPC 메커니즘에서 사용할 수 있다.
자세한 사항은 http://genivi.github.io/capicxx-core-tools/ 를 참고
CommonAPI C++ D-Bus 바인딩은 표준 D-Bus 라이이브러리를 기반으로 하지만 런타임 코드와 함께 게시되는 libdbus 패치가 필요하다.
기본 기능
D-Bus 메시지의 고성능 직렬화
링크
CommonAPI D-Bus C++ User Guide
CommonAPIDBusCppUserGuide.pdf 문서 참고
의존성
libdbus , CommonAPI , cmake
제한사항
Dbus 서명의 경우 255자를 넘지 않아야 함
설치시 관련 필요 라이브러리
DBus
dbus-1.12.2-r0
dbus-c++ 1_0.9.0
common-api-c++ 3.1.12-r0
common-api-c++-dbus 3.1.12-r0
common-api-c++-someip 3.1.12-r0
vsomeip 2.10.21
관련 소스코드 다운로드
/home/kj/GENIVI/ComAPI_New
$ git clone https://github.com/GENIVI/capicxx-core-runtime.git
$ git clone https://github.com/GENIVI/capicxx-dbus-runtime.git
$ git clone https://github.com/GENIVI/dlt-daemon.git
$ git clone https://github.com/GENIVI/vsomeip.git
$ git clone https://github.com/GENIVI/capicxx-someip-runtime.git
#!/bin/bash
git clone https://github.com/GENIVI/capicxx-core-runtime.git
git clone https://github.com/GENIVI/capicxx-dbus-runtime.git
git clone https://github.com/GENIVI/dlt-daemon.git
git clone https://github.com/GENIVI/vsomeip.git
git clone https://github.com/GENIVI/capicxx-someip-runtime.git
브랜치 변경
현재 우분투의 dbus 버전 확인
$ dpkg -l | grep dbus
$ dpkg -l | grep dbus
dbus 1.12.2-1ubuntu1 amd64 simple interprocess messaging system (daemon and utilities)
dbus-user-session 1.12.2-1ubuntu1 amd64 simple interprocess messaging system (systemd --user integration)
인터넷 검색하여 Ubuntu16.04 dbus download
https://launchpad.net/ubuntu/+source/dbus/1.12.2-1ubuntu1
두파일을 다운로드 한다.
한폴더에 압축해제
tar xvf dbus_1.12.2-1ubuntu1.debian.tar.xz
tar xvf dbus_1.12.2.orig.tar.gz
debian/patches/ubuntu 폴더의 패치 파일 복사 cp * ../../../dbus-1.12.2/
패치적용 접기
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < aa-get-connection-apparmor-security-context.patch
patching file bus/apparmor.c
patching file bus/apparmor.h
patching file bus/driver.c
patching file dbus/dbus-protocol.h
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < dont-stop-dbus.patch
patching file bus/dbus.service.in
접기
capicxx-dbus-runtime/src/dbus-patches 폴더안에 패치파일을 dbus 폴더로 복사한다.
소스의 패치적용
패치적용하기 접기
$ ls -alh *patch
-rw-r--r-- 1 kj kj 318 1월 3 15:07 capi-dbus-1-pc.patch
-rw-r--r-- 1 kj kj 7.8K 1월 3 15:07 capi-dbus-add-send-with-reply-set-notify.patch
-rw-r--r-- 1 kj kj 7.9K 1월 3 15:07 capi-dbus-add-support-for-custom-marshalling.patch
-rw-r--r-- 1 kj kj 567 1월 3 15:07 capi-dbus-block-acquire-io-path-on-send.patch
-rw-r--r-- 1 kj kj 752 1월 3 15:07 capi-dbus-correct-dbus-connection-block-pending-call.patch
-rw-r--r-- 1 kj kj 618 1월 3 15:07 capi-dbus-send-with-reply-and-block-delete-reply-on-error.patch
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < capi-dbus-1-pc.patch
patching file dbus-1.pc.in
Hunk #1 succeeded at 19 (offset 1 line).
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < capi-dbus-add-send-with-reply-set-notify.patch
patching file dbus/dbus-connection.c
Hunk #1 succeeded at 3500 (offset 18 lines).
patching file dbus/dbus-connection.h
Hunk #1 succeeded at 230 (offset 1 line).
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < capi-dbus-add-support-for-custom-marshalling.patch
patching file dbus/dbus-message.c
Hunk #1 succeeded at 3746 (offset 301 lines).
Hunk #2 succeeded at 5050 (offset 377 lines).
patching file dbus/dbus-message.h
Hunk #1 succeeded at 170 (offset 32 lines).
Hunk #2 succeeded at 302 with fuzz 1 (offset 37 lines).
patching file dbus/dbus-string.c
Hunk #1 succeeded at 744 (offset 14 lines).
patching file dbus/dbus-string.h
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < capi-dbus-block-acquire-io-path-on-send.patch
patching file dbus/dbus-connection.c
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < capi-dbus-correct-dbus-connection-block-pending-call.patch
patching file dbus/dbus-connection.c
Hunk #1 succeeded at 2526 (offset 1 line).
kj@kj:~/GENIVI/ComAPI_New/dbus/dbus-1.12.2$ patch -p1 < capi-dbus-send-with-reply-and-block-delete-reply-on-error.patch
patching file dbus/dbus-connection.c
Hunk #1 succeeded at 3736 (offset 27 lines).
Hunk #2 succeeded at 6527 (offset 84 lines).
접기
dbus-1.12.2 설치하기
./configure --prefix=/opt/Ngenivi --with-system-socket=/run/dbus/system_bus_socket
펼치기 접기
D-Bus 1.12.2
==============
prefix: /opt/Ngenivi
exec_prefix: ${prefix}
libdir: /opt/Ngenivi/lib
libexecdir: /opt/Ngenivi/libexec
bindir: /opt/Ngenivi/bin
sysconfdir: /opt/Ngenivi/etc
localstatedir: /opt/Ngenivi/var
runstatedir: /opt/Ngenivi/var/run
datadir: /opt/Ngenivi/share
source code location: .
compiler: gcc
cflags: -fno-strict-aliasing -fno-common -Wall -Wextra -Wundef -Wnested-externs -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wformat=2 -Wold-style-definition -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wimplicit-function-declaration -Wreturn-type -Wswitch-enum -Wswitch-default -Wchar-subscripts -Wfloat-equal -Wpointer-sign -Wno-deprecated-declarations -Wno-unused-label -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations -Wno-error=unused-label
cppflags:
cxxflags: -fno-strict-aliasing -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wno-overloaded-virtual -Wswitch-enum -Wswitch-default -Wchar-subscripts -Wfloat-equal -Wno-deprecated-declarations -Wno-unused-label -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=overloaded-virtual -Wno-error=deprecated-declarations -Wno-error=unused-label
ldflags: -Wl,--no-as-needed
64-bit int: long
32-bit int: int
16-bit int: short
Doxygen: /usr/bin/doxygen
xmlto: /usr/bin/xmlto
ducktype: no
yelp-build: no
Rebuilding generated files: yes
gcc coverage profiling: no
Building embedded tests: no
Building modular tests: auto
- with GLib: yes
Installing tests: no
Building verbose mode: no
Building assertions: no
Building checks: yes
Building bus stats API: yes
Building SELinux support: no
Building AppArmor support: no
Building inotify support: yes
Building kqueue support: no
Building systemd support: yes
Building X11 code: yes
Building Doxygen docs: yes
Building Ducktype docs: no
Building XML docs: yes
Building launchd support: no
System bus socket: /run/dbus/system_bus_socket
System bus address: unix:path=/run/dbus/system_bus_socket
System bus PID file: /opt/Ngenivi/var/run/dbus/pid
Session bus listens on: unix:tmpdir=/tmp
Session clients connect to: autolaunch:
pam_console auth dir: (none)
Console owner file: no
Console owner file path:
System bus user: messagebus
Session bus services dir: /opt/Ngenivi/share/dbus-1/services
'make check' socket dir: /tmp
접기
make -C dbus
make -C dbus install
make install-pkgconfigDATA
/bin/mkdir -p '/opt/Ngenivi/lib/pkgconfig'
/usr/bin/install -c -m 644 dbus-1.pc '/opt/Ngenivi/lib/pkgconfig'
환경변수 적용하기
export PKG_CONFIG_PATH=/opt/Ngenivi/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/opt/Ngenivi/lib/:$LD_LIBRARY_PATH
설치시 폴더이동후 build 폴더생성은 생략하도록 한다.
capicxx-core-runtime 설치하기
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX= /opt/Ngenivi . .
capicxx-dbus-runtime 설치하기
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX= /opt/Ngenivi . .
vsomeip 설치
cmake -D USE_INSTALLED_COMMONAPI=ON -D CMAKE_INSTALL_PREFIX=/opt/Ngenivi/ ..
capicxx-someip-runtime 설치
cmake -D USE_INSTALLED_COMMONAPI=ON -D CMAKE_INSTALL_PREFIX= PREFIX=/opt/Ngenivi/ ..
dlt-daemon 까지 동일하게 설치
관련 라이브러리 설치완료
환경변수 파일 생성
소스코드 생성은 다음 포스팅을 참고
2019/01/02 - [Embedded/CommonAPI] - [CommonAPI] tool 설치 작성중