Code Monkey home page Code Monkey logo

genivi-capi-someip-examples's Introduction

genivi-capi-someip-examples

Examples of GENIVI CommonAPI usage via SOMEIP. They cover Linux (tested on Ubuntu) and Android AOSP and NDK cases.

For Android NDK please refer next Android Studio project: https://github.com/nkh-lab/ndk-capi-hello-world

Dependencies

Used codegeneartion tool projects:

  1. https://github.com/GENIVI/capicxx-core-tools 3.2.0.1
  2. https://github.com/GENIVI/capicxx-someip-tools 3.2.0.1

Runtime libraries:

  1. https://github.com/GENIVI/vsomeip 3.1.20
  2. https://github.com/GENIVI/capicxx-core-runtime 3.2.0
  3. https://github.com/GENIVI/capicxx-someip-runtime.git 3.2.0

Codegeneration

Described below codegeneration tools are not the part of the given repository. It means that they are compiled and placed manualy with whole theirs output stuff to:

./tools/commonapi-generator/x86_64
./tools/commonapi-someip-generator/x86_64

acordingly.

CommonAPI, fidl -> src-gen/commonapi -> Service and Client executables

Project: https://github.com/GENIVI/capicxx-core-tools How to build generator:

cd ./capicxx-core-tools/org.genivi.commonapi.releng
mvn -Dtarget.id=org.genivi.commonapi.core.target clean verify

Copy generator output stuff:

cd org.genivi.commonapi.core.cli.product/target/products
unzip commonapi_core_generator.zip -d ~/My/Projects/genivi-capi-someip-examples/tools/commonapi-generator/x86_64

Codegeneration:

cd ./tools/commonapi-generator/x86_64
./commonapi-core-generator-linux-x86_64 -sk -d ../../../src-gen/commonapi ../../../fidl/Interface1.fidl
cd ./src-gen/commonapi/v0/commonapi/examples
$ ls
Interface1.hpp
Interface1ProxyBase.hpp
Interface1Proxy.hpp
Interface1StubDefault.cpp (-sk)
Interface1StubDefault.hpp (-sk)
Interface1Stub.hppp

SOMEIP, fdepl -> src-gen/someip -> SOME/IP library

Project: https://github.com/GENIVI/capicxx-someip-tools How to build generator:

cd ./capicxx-someip-tools/org.genivi.commonapi.someip.releng
mvn clean verify -DCOREPATH=../../capicxx-core-tools -Dtarget.id=org.genivi.commonapi.someip.target

Copy generator output stuff:

cd org.genivi.commonapi.someip.cli.product/target/products
unzip commonapi_someip_generator.zip -d ~/My/Projects/genivi-capi-someip-examples/tools/commonapi-someip-generator/x86_64

Codegeneration:

cd ./tools/commonapi-someip-generator/x86_64
./commonapi-someip-generator-linux-x86_64 -d ../../../src-gen/someip ../../../fidl/Interface1.fdepl
cd ./src-gen/someip/v0/commonapi/examples
$ ls
Interface1SomeIPDeployment.cpp
Interface1SomeIPDeployment.hpp
Interface1SomeIPProxy.cpp
Interface1SomeIPProxy.hpp
Interface1SomeIPStubAdapter.cpp
Interface1SomeIPStubAdapter.hpp

Runtime dependencies

vSOMEIP runtime library

Project: https://github.com/GENIVI/vsomeip How to build and install:

cd build
cmake -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

CommonAPI runtime library

Project: https://github.com/GENIVI/capicxx-core-runtime How to build and install:

cd build
cmake -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

Useful to enforce logging: CMake:

cmake -DMAX_LOG_LEVEL=VERBOSE -DUSE_CONSOLE=ON ..

AOSP, Android.bp cflags: "-DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_VERBOSE", "-DUSE_CONSOLE",

CommonAPI-SOMEIP and VSOMEIP runtime libraries

Project: https://github.com/GENIVI/capicxx-someip-runtime.git which depends on VSOMEIP Project: https://github.com/GENIVI/vsomeip.git

How to build and install:

cd build
cmake -D USE_INSTALLED_COMMONAPI=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

To enforce logging use the same configuration like above for CommonAPI.

Configuration files -> ./config

CommonAPI -> commonapi.ini

Main point is describe the binding of the interfaces with SOME/IP libraries which are loaded dinamicaly during runtime.

But if CMake -DCOMMONAPI_INTERNAL_COMPILATION=ON (-> #define COMMONAPI_INTERNAL_COMPILATION) is defined all generated deplyoment SOMEIP stuff could be built in into Service and Client parts and therefore commonapi.ini and runtime SOME/IP library are not needed.

VSOMEIP -> vsomeip.json

  • Binds parameters from *.fdepl with VSOMEIP configuration.
  • Sets routing. Would it be on Service side or by additional "vsomeipd" executable.

Scripts -> ./scripts

Set predefined envairoment variables with values to coresponding configuration files and describe place where SOME/IP libraries are placed which would be loaded in runtime.

Build

On Ubuntu

By CMake:

cd ./build
cmake ..
make

or for switch off COMMONAPI_INTERNAL_COMPILATION, it is ON by default

cd ./build
cmake -DCOMMONAPI_INTERNAL_COMPILATION=OFF ..
make

On AOSP

Prerequisite:

ln -s ./aosp/runtime_lib.bp Android.bp

or for defined COMMONAPI_INTERNAL_COMPILATION

ln -s ./aosp/internal_cmp.bp Android.bp

Via mma or add to /device/linaro/hikey/hikey960/device-hikey960.mk

$(call inherit-product-if-exists, vendor/genivi-capi-someip-examples/aosp/config.mk)

Run

On Ubuntu

cd ./scripts
./RunInterface1Service.sh
./RunInterface1Client.sh

or for defined COMMONAPI_INTERNAL_COMPILATION

./RunInterface1Service_InternalCompilation.sh
./RunInterface1Client_InternalCompilation.sh

On AOSP

Manualy under root:

Example for runtime SOMEIP interface library, COMMONAPI_INTERNAL_COMPILATION not defined Service:

VSOMEIP_APPLICATION_NAME=Interface1-Service \
VSOMEIP_CONFIGURATION=/vendor/etc/genivi-capi-someip-examples/vsomeip.json \
COMMONAPI_CONFIG=/vendor/etc/genivi-capi-someip-examples/commonapi.ini \
Interface1-Service

Client:

VSOMEIP_APPLICATION_NAME=Interface1-Client \
VSOMEIP_CONFIGURATION=/vendor/etc/genivi-capi-someip-examples/vsomeip.json \
COMMONAPI_CONFIG=/vendor/etc/genivi-capi-someip-examples/commonapi.ini \
Interface1-Client

or for defined COMMONAPI_INTERNAL_COMPILATION

VSOMEIP_APPLICATION_NAME=Interface1-Service \
VSOMEIP_CONFIGURATION=/vendor/etc/genivi-capi-someip-examples/vsomeip.json \
Interface1-Service

Client:

VSOMEIP_APPLICATION_NAME=Interface1-Client \
VSOMEIP_CONFIGURATION=/vendor/etc/genivi-capi-someip-examples/vsomeip.json \
Interface1-Client

Via init.rc

Please see aosp stuff.

How sockets are used

hikey960:/ $ ss -x

Netid  State      Recv-Q Send-Q                  Local Address:Port     Peer Address:Port
u_str  ESTAB      0      0     /data/vendor/vsomeip/vsomeip-0 19685     * 0
u_str  ESTAB      0      0                                  * 19689     * 0
u_str  ESTAB      0      0  /data/vendor/vsomeip/vsomeip-5555 26232     * 0
u_str  ESTAB      0      0                                  * 26236     * 0
u_str  ESTAB      0      0  /data/vendor/vsomeip/vsomeip-4444 26237     * 0

genivi-capi-someip-examples's People

Contributors

nkh-lab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

genivi-capi-someip-examples's Issues

Connecting my Linux machine with the Android through vsomeip

Hello Mykola,

I want to connect the server application on my android image to the client on my Linux machine through vsomeip.

I followed up the steps in this repo and in vsomeip-in-10-minutes and I succeed to make the client and server applications see and communicate with each other.

So now I want to move the server to the android
But when I ran the server on android

VSOMEIP_APPLICATION_NAME=Interface1-Service \
VSOMEIP_BASE_PATH=/data/vendor/vsomeip/ \
VSOMEIP_CONFIGURATION=/vendor/etc/genivi-capi-someip-examples/vsomeip.json \
Interface1-Service 

It gives error :

> [CAPI][INFO] Loading configuration file '/etc/commonapi.ini'
> [CAPI][INFO] Using default binding 'dbus'
> [CAPI][INFO] Using default shared library folder '/usr/local/lib/commonapi'
> [CAPI][INFO] Registering function for creating "commonapi.examples.Interface1:v0_1" stub adapter.
> [CAPI][INFO] Registering stub for "local:commonapi.examples.Interface1:v0_1:commonapi.examples.Interface1"
> Segmentation fault

and the output of the logcat :

> 02-16 13:21:57.635  2660  2661 I Interface1Service: Interface1Service.cpp:21 main() Hello from Interface1Service
> 02-16 13:21:57.635  2660  2661 I Interface1Service: Interface1Service.cpp:24 main() Check configured environment variables:
> 02-16 13:21:57.635  2660  2661 I Interface1Service: Interface1Service.cpp:26 main()     VSOMEIP_APPLICATION_NAME: Interface1-Service
> 02-16 13:21:57.635  2660  2661 I Interface1Service: Interface1Service.cpp:27 main()     VSOMEIP_CONFIGURATION:    /vendor/etc/genivi-capi-someip-examples/vsomeip.json
> 02-16 13:21:57.635  2660  2661 I Interface1Service: Interface1Service.cpp:28 main()     VSOMEIP_BASE_PATH:        /data/vendor/vsomeip/
> 02-16 13:21:57.636  2660  2661 I Interface1Service: Interface1Service.cpp:29 main()     COMMONAPI_CONFIG:         
> 02-16 13:21:57.639  2660  2661 I Interface1-Service: Parsed vsomeip configuration in 1ms
> 02-16 13:21:57.640  2660  2661 I Interface1-Service: Using configuration file: "/vendor/etc/genivi-capi-someip-examples/vsomeip.json".
> 02-16 13:21:57.640  2660  2661 I Interface1-Service: Configuration module loaded.
> 02-16 13:21:57.640  2660  2661 I Interface1-Service: Initializing vsomeip application "Interface1-Service".
> 02-16 13:21:57.640  2660  2661 I Interface1-Service: Instantiating routing manager [Host].
> 02-16 13:21:57.641  2660  2661 I Interface1-Service: create_local_server Routing endpoint at /data/vendor/vsomeip/vsomeip-0
> 02-16 13:21:57.641  2660  2661 I Interface1-Service: Service Discovery enabled. Trying to load module.
> 02-16 13:21:57.643  2660  2661 I Interface1-Service: Service Discovery module loaded.
> 02-16 13:21:57.644  2660  2661 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 2661 (Interface1-Serv), pid 2660 (Interface1-Serv)
> 02-16 13:21:57.672  2664  2664 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
> 02-16 13:21:57.674   224   224 I tombstoned: received crash request for pid 2661
> 02-16 13:21:57.674  2664  2664 I crash_dump64: performing dump of process 2660 (target tid = 2661)
> 01-01 00:29:32.935     0     0 I logd    : logdr: UID=0 GID=0 PID=2664 n tail=0 logMask=8 pid=2660 start=0ns deadline=0ns
> 01-01 00:29:32.950     0     0 I logd    : logdr: UID=0 GID=0 PID=2664 n tail=0 logMask=1 pid=2660 start=0ns deadline=0ns
> 02-16 13:21:57.769  2664  2664 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
> 02-16 13:21:57.769  2664  2664 F DEBUG   : Build fingerprint: 'Raspberry/aosp_rpi4/rpi4:12/SQ3A.220705.004/eng.dev.20230212.152714:userdebug/test-keys'
> 02-16 13:21:57.769  2664  2664 F DEBUG   : Revision: '0'
> 02-16 13:21:57.769  2664  2664 F DEBUG   : ABI: 'arm64'
> 02-16 13:21:57.769  2664  2664 F DEBUG   : Timestamp: 2023-02-16 13:21:57.676592290+0000
> 02-16 13:21:57.769  2664  2664 F DEBUG   : Process uptime: 0s
> 02-16 13:21:57.769  2664  2664 F DEBUG   : Cmdline: Interface1-Service
> 02-16 13:21:57.769  2664  2664 F DEBUG   : pid: 2660, tid: 2661, name: Interface1-Serv  >>> Interface1-Service <<<
> 02-16 13:21:57.769  2664  2664 F DEBUG   : uid: 0
> 02-16 13:21:57.769  2664  2664 F DEBUG   : tagged_addr_ctrl: 0000000000000001
> 02-16 13:21:57.769  2664  2664 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
> 02-16 13:21:57.769  2664  2664 F DEBUG   : Cause: null pointer dereference
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x0  0000000000000000  x1  b400007227831fa0  x2  b400007147827ab0  x3  0000000000000001
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x4  0000000000000000  x5  000000730ac9d698  x6  2d636463606e6b1f  x7  7f7f7f7f7f7f7f7f
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x8  b4000072078380a8  x9  0000000000000008  x10 0000000000000000  x11 0000000000000003
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x12 0000fffffffff3ff  x13 0000000000000021  x14 000000707781d848  x15 000000164cf57923
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x16 000000730a8b0e80  x17 000000730ac9d058  x18 00000070770aa000  x19 b400007227831c90
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x20 b400007187831e50  x21 000000707781f010  x22 b4000071b7835730  x23 000000707781f010
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x24 b40000721782da08  x25 000000707781e1f8  x26 0000000000000022  x27 000000707781eaa8
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     x28 000000707781eac0  x29 000000707781e110
> 02-16 13:21:57.770  2664  2664 F DEBUG   :     lr  000000730a80dc44  sp  000000707781deb0  pc  000000730a80dc98  pst 0000000060000000
> 02-16 13:21:57.771  2664  2664 F DEBUG   : backtrace:
> 02-16 13:21:57.771  2664  2664 F DEBUG   :       #00 pc 000000000017fc98  /vendor/lib64/libvsomeip3.so (vsomeip_v3::routing_manager_impl::init()+672) (BuildId: 4369efdec81313ff326354469d2424cc)
> 02-16 13:21:57.771  2664  2664 F DEBUG   :       #01 pc 00000000001d14d4  /vendor/lib64/libvsomeip3.so (vsomeip_v3::application_impl::init()+3468) (BuildId: 4369efdec81313ff326354469d2424cc)
> 02-16 13:21:57.771  2664  2664 F DEBUG   :       #02 pc 0000000000029800  /vendor/lib64/libCommonAPI-SomeIP.so (CommonAPI::SomeIP::Connection::connect(bool)+56) (BuildId: 0518e4329f7ade0c45b998216c4ebac7)
> 02-16 13:21:57.771  2664  2664 F DEBUG   :       #03 pc 00000000000362b4  /vendor/lib64/libCommonAPI-SomeIP.so (CommonAPI::SomeIP::Factory::getConnection(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+252) (BuildId: 0518e4329f7ade0c45b998216c4ebac7)
> 02-16 13:21:57.771  2664  2664 F DEBUG   :       #04 pc 0000000000037240  /vendor/lib64/libCommonAPI-SomeIP.so (CommonAPI::SomeIP::Factory::registerStub(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<CommonAPI::StubBase>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+872) (BuildId: 0518e4329f7ade0c45b998216c4ebac7)
> 02-16 13:21:57.771  2664  2664 F DEBUG   :       #05 pc 0000000000014e30  /vendor/lib64/libCommonAPI.so (CommonAPI::Runtime::registerStubHelper(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<CommonAPI::StubBase>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)+216) (BuildId: 02bda219422504c776bfe85f83fd7ee9)
> 02-16 13:21:57.771  2664  2664 F DEBUG   :       #06 pc 0000000000014bac  /vendor/lib64/libCommonAPI.so (CommonAPI::Runtime::registerStub(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<CommonAPI::StubBase>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+140) (BuildId: 02bda219422504c776bfe85f83fd7ee9)
> 02-16 13:21:57.772  2664  2664 F DEBUG   :       #07 pc 000000000000dac0  /vendor/bin/Interface1-Service (bool CommonAPI::Runtime::registerService<Interface1StubImpl>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<Interface1StubImpl>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+192) (BuildId: 56a53a499135c9c7a8dc80b7cd1575bf)
> 02-16 13:21:57.772  2664  2664 F DEBUG   :       #08 pc 000000000000d4b0  /vendor/bin/Interface1-Service (Interface1Service::main()+880) (BuildId: 56a53a499135c9c7a8dc80b7cd1575bf)
> 02-16 13:21:57.772  2664  2664 F DEBUG   :       #09 pc 000000000000f088  /vendor/bin/Interface1-Service (void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (Interface1Service::*)(), Interface1Service*> >(void*)+88) (BuildId: 56a53a499135c9c7a8dc80b7cd1575bf)
> 02-16 13:21:57.772  2664  2664 F DEBUG   :       #10 pc 00000000000b3338  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 3e4fc6e0e3a1107f79585e6a0d01cd6e)
> 02-16 13:21:57.772  2664  2664 F DEBUG   :       #11 pc 00000000000516c8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 3e4fc6e0e3a1107f79585e6a0d01cd6e)

I am using android 12 on Raspberry Pi 4

So I would be very grateful if you can help me in this issue

VHAL / vsome/ip Integration runtime issue

Hello Mykola,

I am trying to integrate the vsomeip into your customized vhal extension.
But when the vhal runs it gives this error

01-01 00:00:10.928 282 371 E [email protected]: is_routing_manager: Could not open /data/vendor/vsomeip/vsomeip.lck: No such file or directory

[email protected]: local_client_endpoint::connect: Couldn't connect to: /data/vendor/vsomeip/vsomeip-0 (No such file or directory / 2)

So I will be very grateful if you could help me or give me any recommendations.

The full logcat :

01-01 00:00:10.888   282   282 I VehicleService.cpp: main(): Hello World form nkh-lab VHAL!
01-01 00:00:10.889   282   371 I SOMEIP_VHAL_INTERFACE: Interface1Client.cpp:50 main() [email protected]: Hello from [email protected]
01-01 00:00:10.890   282   282 I [email protected]: VehicleHalManager::init
01-01 00:00:10.890   282   371 I SOMEIP_VHAL_INTERFACE: Interface1Client.cpp:53 main() Check configured environment variables:
01-01 00:00:10.891   282   282 I VehicleService.cpp: main(): Registering as service...
01-01 00:00:10.892   282   371 I SOMEIP_VHAL_INTERFACE: Interface1Client.cpp:55 main()     VSOMEIP_APPLICATION_NAME: [email protected]
01-01 00:00:10.892   282   371 I SOMEIP_VHAL_INTERFACE: Interface1Client.cpp:56 main()     VSOMEIP_CONFIGURATION:    /vendor/etc/genivi-capi-someip-exapmles/vsomeip.json
01-01 00:00:10.892   282   371 I SOMEIP_VHAL_INTERFACE: Interface1Client.cpp:57 main()     VSOMEIP_BASE_PATH:        /data/vendor/vsomeip/
01-01 00:00:10.892   282   371 I SOMEIP_VHAL_INTERFACE: Interface1Client.cpp:58 main()     COMMONAPI_CONFIG:         
01-01 00:00:10.894   282   282 I HidlServiceManagement: Registered [email protected]::IVehicle/default
01-01 00:00:10.895   282   282 I VehicleService.cpp: main(): Vehicle service ready
01-01 00:00:10.896   282   371 I [email protected]: Parsed vsomeip configuration in 0ms
01-01 00:00:10.896   282   371 I [email protected]: Configuration module loaded.
01-01 00:00:10.928   282   371 I [email protected]: Initializing vsomeip application "[email protected]".
01-01 00:00:10.928   282   371 E [email protected]: is_routing_manager: Could not open /data/vendor/vsomeip/vsomeip.lck: No such file or directory
01-01 00:00:10.928   282   371 I [email protected]: Instantiating routing manager [Proxy].
01-01 00:00:10.929   282   371 I [email protected]: Client [ffff] is connecting to [0] at /data/vendor/vsomeip/vsomeip-0
01-01 00:00:10.929   282   371 I [email protected]: Application([email protected], ffff) is initialized (11, 100).
01-01 00:00:10.930   282   375 I [email protected]: Starting vsomeip application "[email protected]" (ffff) using 2 threads I/O nice 255
01-01 00:00:10.931   282   371 I SOMEIP_VHAL_INTERFACE: Interface1Client.cpp:66 main() [email protected]: Checking availability!
01-01 00:00:10.931   282   376 I [email protected]: main dispatch thread id from application: ffff ([email protected]) is: 72169f6d00 TID: 376
01-01 00:00:10.931   282   377 I [email protected]: shutdown thread id from application: ffff ([email protected]) is: 72168f9d00 TID: 377
01-01 00:00:10.931   282   375 W [email protected]: local_client_endpoint::connect: Couldn't connect to: /data/vendor/vsomeip/vsomeip-0 (No such file or directory / 2)
01-01 00:00:10.932   282   375 I [email protected]: io thread id from application: ffff ([email protected]) is: 7218af3d00 TID: 375
01-01 00:00:10.932   282   378 I [email protected]: io thread id from application: ffff ([email protected]) is: 72147fcd00 TID: 378
01-01 00:00:10.932   282   375 I [email protected]: routing_manager_proxy::on_disconnect: Client 0xffff calling host_->on_state with DEREGISTERED

AOSP hardwera service(aidl) build commonAPI gen_code failed

Using AIDL to generate native service,build commonAPI gen_code and AIDL platform_ndk.so
build failed: error message

external/libcxx/include/memory:4972:16: error: use of dynamic_cast requires -frtti
_Tp* __p = dynamic_cast<_Tp*>(__r.get());

this error message solution:Android.bp add :rtti :true
but cause a new problem,
ld.lld: error: undefined symbol: typeinfo for aidl::android::hardware::xxx::adcu_hmiservice::BnAdcuService

referenced by AdcuHmiServiceStub.cpp
out/soong/.intermediates/hardware/interfaces/xxx/adcu/default/android.hardware.xxx.adcu_hmiservice_bin/android_vendor.32_arm64_armvnterfaces/xxx/adcu/default/src/AdcuHmiServiceStub.o:(typeinfo for aidl::android::hardware::xxx::adcu_hmiservice::stub::AdcuHmiServiceStub)
did you mean: vtable for aidl::android::hardware::xxx::adcu_hmiservice::BnAdcuService
defined in: out/soong/.intermediates/hardware/interfaces/xxx/adcu/android.hardware.xxx.adcu_hmiservice-V1-ndk_platform/android_vendor.32_arm64_arid.hardware.xxx.adcu_hmiservice-V1-ndk_platform.so
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
13:49:29 ninja failed with: exit status 1

AIDL gencode build failed,
Have you ever encountered this problem
Android.bp

cc_binary {
name: "android.hardware.xxx.adcu_hmiservice_bin",
relative_install_path: "hw",
stl: "c++_shared",
init_rc: ["config/xxx-adcu_hmiservice1.rc"],
vintf_fragments: ["config/xxx-adcu_hmiservice1.xml"],
vendor: true,
owner:"omg",
srcs: [
"src/AdcuHmiServiceMain.cpp",
"src/AdcuHmiServiceStub.cpp",
],
//ldflags: ["-export-dynamic"],
shared_libs: [
"libbase",
"libbinder_ndk",
"android.hardware.xxx.adcu_hmiservice-V1-ndk_platform",
"libCommonAPI",
"libADCU_HmiService-someip",
],
local_include_dirs: ["include", "src", "include/aidl/android/hardware/xxx/adcu_hmiservice/"],

 cppflags: [                   
    "-DBOOST_LOG_DYN_LINK",
    "-D_GLIBCXX_USE_NANOSLEEP",
    "-fexceptions",
    "-Wc++17-extensions",
    "-Wno-non-virtual-dtor",
    "-Wno-unused-const-variable",
    "-Wno-unused-parameter",
    "-Wno-unused-private-field",
    "-Wno-unused-lambda-capture",
    "-Wno-unused-variable",
    "-Wno-unused-local-typedef",
    "-Wno-sign-compare",
    "-Wno-format",
    "-frtti",
    "-Wno-header-guard",
    "-Wno-overloaded-virtual",
    "-Wno-implicit-fallthrough",
    "-Wno-error",
    "-Bdynamic",
    "-Wno-shorten-64-to-32",
    "-D_GTHREAD_USE_MUTEX_INIT_FUNC",
    "-D_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC",],
   // rtti: true

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.