CommonAPI stub, proxy, common ๋ถ๋ฅํ์ฌ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ง๋ค๊ธฐ
CommonAPI Generator๋ก ์์ฑ๋๋ file์์ Stub, Proxy, Common์ผ๋ก ์ด๋ค ํ์ผ๋ค์ด ์์ฑ๋๋์ง ํ์ธํ ์ ์์๋๋ฐ, ๊ฐ์์ ๋๋ ํ ๋ฆฌ์ ํด๋น ํ์ผ ์์ฑํ๋ ๋ฐฉ๋ฒ์ ์์๋ณด์.
ํ์ผ์ ๋๋ ์ ์์ฑํ๋๊ฒ์ SOME/IP๋ DBUS์ ๊ฐ์ด ๋ฐ์ธ๋ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ง๋ค๋ ํ์ฉํ๋ค.
๋์ ์ผ๋ก ๋ฐ์ธ๋ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๊ตฌ์ฑํ๋ฉด ์คํํ์ผ์ ์คํ์ํฌ๋ CommonAPI ๊ด๋ จ ํ๊ฒฝํ์ผ(commonapi.ini, commonapi-somip.ini)๋ ๊ฐ์ด ๊ตฌ์ฑํ์ฌ์ผ ํ๋ค. - ์ถํ ์ ๋ฆฌ
commonapi Someip Generator์ ์ต์ ์ ์กฐ์ ํด์ ๊ฐ๊ฐ์ ์์น๋ก ํ์ผ์ ์์ฑํ๋ค.
-dc directory : Common file๋ค์ directory์ ์์ฑ
-dp directory : Proxy file๋ค์ directory์ ์์ฑ
-ds directory : Stub file๋ค์ directory์ ์์ฑ
์์ ์์
hello$ ../commonapi_someip_generator/commonapi-someip-generator-linux-x86 -ll verbose /fidl/HelloWorld.fdepl
์ ๊ฐ์ด ์ํํ๋ ๋ช ๋ น์ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝํ๋ค.
hello$ ../commonapi_someip_generator/commonapi-someip-generator-linux-x86 -ll verbose /fidl/HelloWorld.fdepl -dc src-gen_someip/common -dp src-gen_someip/proxy -ds src-gen_someip/stub
์ด์ Common, Stub, Proxy ์ฉ SOME/IP ๋์ ๋ฐ์ธ๋ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(.so)๋ฅผ ๋ง๋ค์ด๋ณด์.
CMakeLists.txt๋ฅผ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝํ๋ค.
build ๋๋ ํ ๋ฆฌ๋ก ์ด๋ํ์ฌ
$ cmake ..
$ make
ํ์ผ์ ๋๋ ์ ์์ฑํ๋๊ฒ์ SOME/IP๋ DBUS์ ๊ฐ์ด ๋ฐ์ธ๋ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ง๋ค๋ ํ์ฉํ๋ค.
๋์ ์ผ๋ก ๋ฐ์ธ๋ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๊ตฌ์ฑํ๋ฉด ์คํํ์ผ์ ์คํ์ํฌ๋ CommonAPI ๊ด๋ จ ํ๊ฒฝํ์ผ(commonapi.ini, commonapi-somip.ini)๋ ๊ฐ์ด ๊ตฌ์ฑํ์ฌ์ผ ํ๋ค. - ์ถํ ์ ๋ฆฌ
commonapi Someip Generator์ ์ต์ ์ ์กฐ์ ํด์ ๊ฐ๊ฐ์ ์์น๋ก ํ์ผ์ ์์ฑํ๋ค.
-dc directory : Common file๋ค์ directory์ ์์ฑ
-dp directory : Proxy file๋ค์ directory์ ์์ฑ
-ds directory : Stub file๋ค์ directory์ ์์ฑ
์์ ์์
hello$ ../commonapi_someip_generator/commonapi-someip-generator-linux-x86 -ll verbose /fidl/HelloWorld.fdepl
์ ๊ฐ์ด ์ํํ๋ ๋ช ๋ น์ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝํ๋ค.
hello$ ../commonapi_someip_generator/commonapi-someip-generator-linux-x86 -ll verbose /fidl/HelloWorld.fdepl -dc src-gen_someip/common -dp src-gen_someip/proxy -ds src-gen_someip/stub
์ด์ Common, Stub, Proxy ์ฉ SOME/IP ๋์ ๋ฐ์ธ๋ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(.so)๋ฅผ ๋ง๋ค์ด๋ณด์.
CMakeLists.txt๋ฅผ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝํ๋ค.
- CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
OPTION(USE_INSTALLED_COMMONAPI "Set to OFF to use the local (build tree) version of CommonAPI" OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++0x -Wl,--no-as-needed")
include_directories(
src-gen
src-gen_someip/common
src-gen_someip/proxy
src-gen_someip/stub
~/capicxx-core-runtime/include #capixx-core-runtime์ด ์ค์น๋์ด ์๋ ํด๋
~/capicxx-someip-runtime/include #capixx-someip-runtime์ด ์ค์น๋์ด ์๋ ํด๋
~/vSomeIP/interface #vSomeIP๊ฐ ์ค์น๋์ด ์๋ ํด๋
)
link_directories(
~/COMMONAPI #CommonAPI ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ค์น๋์ด ์๋ ํด๋
)
add_library(HelloWorldsomeipCommon SHARED
src-gen_someip/common/v1/commonapi/HelloWorldSomeIPDeployment.cpp )
target_link_libraries(HelloWorldsomeipCommon ~/COMMONAPI/libCommonAPI-SomeIP.so vsomeip )
add_library(HelloWorldsomeipProxy SHARED
src-gen_someip/proxy/v1/commonapi/HelloWorldSomeIPProxy.cpp )
target_link_libraries(HelloWorldsomeipProxy ~/COMMONAPI/libCommonAPI-SomeIP.so vsomeip )
add_library(HelloWorldsomeipStub SHARED
src-gen_someip/stub/v1/commonapi/HelloWorldSomeIPStubAdapter.cpp )
target_link_libraries(HelloWorldsomeipStub ~/COMMONAPI/libCommonAPI-SomeIP.so vsomeip )
build ๋๋ ํ ๋ฆฌ๋ก ์ด๋ํ์ฌ
$ cmake ..
$ make
๊ด๋ จ ํ์ด์ง
- CommonAPI ๊ด๋ จ
- CommonaAPI ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํจ์ค ์ค์
- CommonAPI Stub? Proxy?
- SOME/IP ํค๋ ๊ตฌ์กฐ์ fdeplํ์ผ ๊ด๊ณ
- vSomeIP version 2.14.16 ๋น๋
- CommonAPI Generator๋ก ์์ฑ๋๋ file
- CommonAPI C++ with SOME/IP Example
- Franca ์ค์น ๊ฐ์ด๋
- Linux Xubuntu์ CommonAPI C/C++ ๊ฐ๋ฐํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ
- ๊ฐ๋ฐ๊ด๋ จ
CommonAPI stub, proxy ?
์์ฑ๋ FIDL์ ์ด์ฉํ์ฌ CommonAPI Generator๋ฅผ ๋๋ฆฌ๋ฉด stub code๋ค๊ณผ proxy์ฝ๋๋ค์ด ์์ฑ๋๋ค.
stub๊ณผ proxy๋ ์ด๋ป๊ฒ ๊ตฌ๋ถํ์ฌ ์ฌ์ฉํด์ผ ํ ๊น?
Stub ์์ฑ
Service ์ ๊ณต์
์๊ตฌ์
Proxy ์์ฑ
Client
์ผ์์
stub๊ณผ proxy๋ ์ด๋ป๊ฒ ๊ตฌ๋ถํ์ฌ ์ฌ์ฉํด์ผ ํ ๊น?
Stub ์์ฑ
Service ์ ๊ณต์
์๊ตฌ์
Proxy ์์ฑ
Client
์ผ์์
๊ด๋ จ ํ์ด์ง
- CommonAPI ๊ด๋ จ
- CommonAPI stub, proxy, common ๋ถ๋ฅํ์ฌ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ง๋ค๊ธฐ
- SOME/IP ํค๋ ๊ตฌ์กฐ์ fdeplํ์ผ ๊ด๊ณ
- vSomeIP version 2.14.16 ๋น๋
- CommonAPI Generator๋ก ์์ฑ๋๋ file
- CommonAPI C++ with SOME/IP Example
- Franca ์ค์น ๊ฐ์ด๋
- Linux Xubuntu์ CommonAPI C/C++ ๊ฐ๋ฐํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ
- ๊ฐ๋ฐ๊ด๋ จ
CommonAPI Generator๋ก ์์ฑ๋๋ file
CommonAPI Generator๋ฅผ ์ด์ฉํ์ฌ ํ๋์ FIDL ํ์ผ๋ก proxy์ stub ์ฝ๋๋ฅผ ์์ฑํ ์ ์๋ค. ์ฌ๊ธฐ์์ ๋ง๋ค์ด์ง๋ ์ฝ๋๋ IPC์ ์ข
๋ฅ(dbus, some/ip)์ ์๊ด์์ด ๋
๋ฆฝ์ ์ผ๋ก ๋์๋๋ ์ฝ๋์ด๋ค.
๊ธฐ๋ณธ์ ์ฐจ
CommonaAPI C++ SOME/IP Example ์์ ๋ง๋ HelloWorld.fidl๊ณผ HelloWorld.fdepl๋ก Generation์ํค๋ฉด Client(Proxy)์ Service(Stub)์ ์ฌ์ฉํ ์์คํ์ผ๋ค์ด ์์ฑ๋๋ค.
CommonAPI Generator๋ก ์์ฑ์ํจ ํ์ผ๋ค์ ์๋์ ๊ฐ๊ณ
๊ณต์ฉ
HelloWorld.hpp
Client์ ์ฌ์ฉ
HelloWorldProxy.hpp
HelloWorldProxyBase.hpp
Stub/Service์ ์ฌ์ฉ
HelloWorldStub.hpp
HelloWorldStubDefault.cpp
HelloWorldStubDefault.hpp
CommonAPI Some/IP Generator๋ก ์์ฑ์ํจ ํ์ผ๋ค์ ๋ค์๊ณผ ๊ฐ๋ค.
Client์ ์ฌ์ฉ
HelloWorldSomeIPProxy.hpp
HelloWorldSomeIPProxy.cpp
HelloWorldSomeIPDeployment.hpp
HelloWorldSomeIPDeployment.cpp
Stub/Service์ ์ฌ์ฉ
HelloWorldSomeIPStubAdapter.hpp
HelloWorldSomeIPStubAdapter.cpp
Ref.
- GENIVI CommonAPI tools (capicxx-core-tools)
๊ธฐ๋ณธ์ ์ฐจ
- FIDL ์์ฑ
- CommonAPI Code Generator๋ฅผ ์ด์ฉํ์ฌ Proxy/Stub ์ฝ๋ ์์ฑ
- Generation Stub ์ฝ๋๋ฅผ ์์๋ฐ์ Stub implement ์ฝ๋ ์์ฑ(xxxStubImpl.hpp, xxxStubImple.cpp).
- Client Application์์ Proxy function์ ํธ์ถ ํ์๋ ๋์ํ ๊ธฐ๋ฅ์ ๊ตฌํ.
- Deployment ์ฌ์์( xxx.fdepl ) ์์ฑ ํ ํด๋น IPC Generator ์คํ(Some/IP ํน์ dbus generator)
- CMake ํ์ผ ์์ฑ
CommonaAPI C++ SOME/IP Example ์์ ๋ง๋ HelloWorld.fidl๊ณผ HelloWorld.fdepl๋ก Generation์ํค๋ฉด Client(Proxy)์ Service(Stub)์ ์ฌ์ฉํ ์์คํ์ผ๋ค์ด ์์ฑ๋๋ค.
- HelloWorld.fdepl
import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "HelloWorld.fidl"
define org.genivi.commonapi.someip.deployment for interface commonapi.HelloWorld {
SomeIpServiceID = 4660 method sayHello {
SomeIpMethodID = 31000
}
}
define org.genivi.commonapi.someip.deployment for provider MyService {
instance commonapi.HelloWorld {
InstanceId = "test"
SomeIpInstanceID = 22136
}
}
- HelloWorld.fidl
package commonapi
interface HelloWorld {
version {major 1 minor 0}
method sayHello {
in {
String name
}
out {
String message
}
}
}
CommonAPI Generator๋ก ์์ฑ์ํจ ํ์ผ๋ค์ ์๋์ ๊ฐ๊ณ
๊ณต์ฉ
HelloWorld.hpp
Client์ ์ฌ์ฉ
HelloWorldProxy.hpp
HelloWorldProxyBase.hpp
Stub/Service์ ์ฌ์ฉ
HelloWorldStub.hpp
HelloWorldStubDefault.cpp
HelloWorldStubDefault.hpp
CommonAPI Some/IP Generator๋ก ์์ฑ์ํจ ํ์ผ๋ค์ ๋ค์๊ณผ ๊ฐ๋ค.
Client์ ์ฌ์ฉ
HelloWorldSomeIPProxy.hpp
HelloWorldSomeIPProxy.cpp
HelloWorldSomeIPDeployment.hpp
HelloWorldSomeIPDeployment.cpp
Stub/Service์ ์ฌ์ฉ
HelloWorldSomeIPStubAdapter.hpp
HelloWorldSomeIPStubAdapter.cpp
Ref.
- GENIVI CommonAPI tools (capicxx-core-tools)
๊ด๋ จ ํ์ด์ง
- CommonAPI ๊ด๋ จ
- CommonAPI stub, proxy, common ๋ถ๋ฅํ์ฌ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ง๋ค๊ธฐ
- CommonAPI Stub? Proxy?
- SOME/IP ํค๋ ๊ตฌ์กฐ์ fdeplํ์ผ ๊ด๊ณ
- vSomeIP version 2.14.16 ๋น๋
- CommonAPI C++ with SOME/IP Example
- Franca ์ค์น ๊ฐ์ด๋
- Linux Xubuntu์ CommonAPI C/C++ ๊ฐ๋ฐํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ
์ผํ์ฉ ๋ง์คํฌ ์ฌ์ฌ์ฉ ํ๊ธฐ
์ฐํํ๋ ด(์ฝ๋ก๋19)์ผ๋ก ๋ง์คํฌ ๊ตฌํ๊ธฐ๊ฐ ํ๋์ ๋ณ๋ฐ๊ธฐ๋ค.. ใ
ก.ใ
ก
๊ทธ๋๋ง ์๋ ๋์ ๋ฏธ์ธ๋จผ์ง๋๋ฌธ์ ์ฌ๋์ ๊ฑฐ ๊ฐ์ง๊ณ ๋ฒํฐ๊ณ ์๋๋ฐ ์ธ์ ๊น์ง ๋ฒํธ ์ ์์์ง...
์ผํ์ฉ ๋ง์คํฌ๋ฅผ ์ธํํ๊ฑฐ๋ ์์ฝ์ฌ๋ก ์๋ ํ๋ฉด ๊ธฐ์กด ์ฑ๋ฅ์ด 3~40% ํ๋ฝํ๋ค๊ณ ํ๋ค.
์๋ ์ UVC(์์ธ์ )๋ก ํ๋ฉด ์ด๋จ๊น ์ถ๋ค. ์ฑ๋ฅ์ด ๋จ์ด์ง๊น?
์ง์์ ์ฌ์ฉํ๊ณ ์๊ธฐ ๊ฑด์กฐ๊ธฐ์ ์๋ ์ด๊ท ๊ธฐ๋ฅ์ ์ด์ฉํด ๋ณด์๋ค..
UVC๋ฅผ ์ฌ๋ค๊ณ ๋ง์คํฌ ํํฐ๊ฐ ์์๋์ง ์๋๋ค๊ณ ํ๋ค.
๋ง์คํฌ ํ์ฅ๋น 1์ฃผ์ผ ์ฐ๊ธฐ
๊ทธ๋๋ง ์๋ ๋์ ๋ฏธ์ธ๋จผ์ง๋๋ฌธ์ ์ฌ๋์ ๊ฑฐ ๊ฐ์ง๊ณ ๋ฒํฐ๊ณ ์๋๋ฐ ์ธ์ ๊น์ง ๋ฒํธ ์ ์์์ง...
์ผํ์ฉ ๋ง์คํฌ๋ฅผ ์ธํํ๊ฑฐ๋ ์์ฝ์ฌ๋ก ์๋ ํ๋ฉด ๊ธฐ์กด ์ฑ๋ฅ์ด 3~40% ํ๋ฝํ๋ค๊ณ ํ๋ค.
์๋ ์ UVC(์์ธ์ )๋ก ํ๋ฉด ์ด๋จ๊น ์ถ๋ค. ์ฑ๋ฅ์ด ๋จ์ด์ง๊น?
์ง์์ ์ฌ์ฉํ๊ณ ์๊ธฐ ๊ฑด์กฐ๊ธฐ์ ์๋ ์ด๊ท ๊ธฐ๋ฅ์ ์ด์ฉํด ๋ณด์๋ค..
UVC๋ฅผ ์ฌ๋ค๊ณ ๋ง์คํฌ ํํฐ๊ฐ ์์๋์ง ์๋๋ค๊ณ ํ๋ค.
๋ง์คํฌ ํ์ฅ๋น 1์ฃผ์ผ ์ฐ๊ธฐ