-
Notifications
You must be signed in to change notification settings - Fork 22
Configure and run
The main concept is CommonAPI address which has format <domain>:<interface>:<instance>
Usually you will use domain and instance to invoke creating proxy or stub. Interface is defined by generator, for example see src-gen/v1/ford/rnd/ML.hpp
in build directory sample
When you invoke proxy or stub CommonAPI loads your shared library according configuration file commonapi.ini
[proxy]
local:ford.rnd.ML:v1_0:ford.rnd.ML=libML.so
In order to CommonAPI loads libraries of vsomeip you have to add into commonapi.ini next lines:
[default]
binding=someip
In order to your applications work on TCP you have to prepare proper deployment files (*.fdepl) See specification for SOME/IP. For example ML.fdepl:
method sayHello {
SomeIpMethodID = 32000
SomeIpReliable = true
}
Also you have to provide configure files for service and client sides.
Example for service side is vsomeip-service.json
"services" :
[
{
"service" : "0x1234",
"instance" : "0x5678",
"reliable" : { "port" : "31000", "enable-magic-cookies" : "false" }
}
],
Example for client side is vsomeip-client.json
"clients" :
[
{
"service" : "0x1234",
"instance" : "0x5678"
}
],
Use service discovery for simple configuration:
"service-discovery" :
{
"enable" : "true"
}
By default service discovery uses 224.0.0.0 range of IP addresses. So you have to set up route on your both hosts with command like:
sudo route add -net 224.0.0.0/4 dev eth0
In order to your applications be able to find all libraries you have to set up LD_LIBRARY_PATH
variable.
Full list libraries:
- libCommonAPI.so
- libCommonAPI-SomeIP.so
- libvsomeip.so
- libvsomeip-sd.so
- libvsomeip-cfg.so
- your shared libraries (libML.so for sample)
In order to your application will be recognized by vsomeip you have to set up name
export VSOMEIP_APPLICATION_NAME=service-sample
In order to your application will be properly configured you have to specify configuration files:
export VSOMEIP_CONFIGURATION=../config/vsomeip-service.json
export COMMONAPI_CONFIG=../config/commonapi.ini
Now you can run your applications. It is good to use vsomeip daemon for routing.
- run vsomeipd
- run service
- run client on another host
You might look at simple scripts for a better understanding: