differentiating identical event-services from a single client #628
-
I have two of the same some/ip devices. Each device acts as a service that can send various event notifications. They're identical except that they each have a different (static) IP address. So far I have tested event receiving with a single device, and it works well. I'd like to be able to subscribe to events from both of the devices using one client. In the receiving client, what is the best way to differentiate which of the devices sent a given event? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @mogar! The way to differentiate between events of the same service, but sent from different devices, is by using To subscribe to the events of both devices, you need to specify the app_->subscribe(SERVICE_ID, INSTANCE_ID_A, EVENTGROUP);
app_->subscribe(SERVICE_ID, INSTANCE_ID_B, EVENTGROUP); To my knowledge, there is no away to get the ip address used by a given service instance at runtime. Ideally, this is something you should know beforehand. Does this answer your question? |
Beta Was this translation helpful? Give feedback.
For further documentation please search the user guide (https://github.com/COVESA/vsomeip/blob/master/documentation/vsomeipUserGuide.md) for "instance" as there are several descriptions that could assist your implementation, also there is several examples of configuration files at: https://github.com/COVESA/vsomeip/tree/master/config