Android Studio example how to use GENIVI CommonAPI via SOME/IP between two app services from native code.
Git submodule projects:
patches/capicxx-core-runtime.patch
: (https://github.com/GENIVI/capicxx-core-runtime.git);patches/capicxx-someip-runtime.patch
: (https://github.com/GENIVI/capicxx-someip-runtime.git);git clone https://github.com/nkh-lab/ndk-capi-hello-world.git
git submodule update --init
cd external/capicxx-core-runtime
git apply ../../patches/capicxx-core-runtime.patch
cd external/capicxx-someip-runtime
git apply ../../patches/capicxx-someip-runtime.patch
or via
./patches/apply-patches.sh
logcat
:
...
2020-06-24 23:16:08.708 15582-15638/com.example.capihelloworld I/Interface1Service: Interface1Service.cpp:16 main() Hello from Interface1Service
2020-06-24 23:16:08.711 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:27 main() Client1: Hello from Interface1Client
2020-06-24 23:16:08.711 15582-15638/com.example.capihelloworld I/Interface1Service: Interface1Service.cpp:33 main() Successfully Registered Service!
2020-06-24 23:16:08.712 15582-15638/com.example.capihelloworld I/Interface1Service: Interface1Service.cpp:37 main() Waiting for calls... (Abort with CTRL+C)
2020-06-24 23:16:08.712 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:41 main() Client1: Checking availability!
2020-06-24 23:16:08.720 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:46 main() Client1: Available...
2020-06-24 23:16:08.721 15582-15643/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:59 operator()() Client1: aString CallStatus: 0
2020-06-24 23:16:08.721 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:68 main() Client1: getAStringAttribute().setValue() was set to: 0
2020-06-24 23:16:08.721 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:71 main() Client1: setUInt32(): 0
2020-06-24 23:16:08.721 15582-15643/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:56 operator()() Client1: aString was changed to: 0
2020-06-24 23:16:11.725 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:81 main() Client1: getUInt32(): 0
2020-06-24 23:16:14.727 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:68 main() Client1: getAStringAttribute().setValue() was set to: 1
2020-06-24 23:16:14.728 15582-15643/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:56 operator()() Client1: aString was changed to: 1
2020-06-24 23:16:14.728 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:71 main() Client1: setUInt32(): 1
2020-06-24 23:16:17.733 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:81 main() Client1: getUInt32(): 1
2020-06-24 23:16:20.735 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:68 main() Client1: getAStringAttribute().setValue() was set to: 2
2020-06-24 23:16:20.735 15582-15643/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:56 operator()() Client1: aString was changed to: 2
2020-06-24 23:16:20.735 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:71 main() Client1: setUInt32(): 2
2020-06-24 23:16:23.740 15582-15640/com.example.capihelloworld I/Interface1Client: Interface1Client.cpp:81 main() Client1: getUInt32(): 2
...