summaryrefslogtreecommitdiff
path: root/implementation/routing
diff options
context:
space:
mode:
authorLutz Bichler <Lutz.Bichler@bmw.de>2014-08-19 17:08:53 +0200
committerLutz Bichler <Lutz.Bichler@bmw.de>2014-08-19 17:08:53 +0200
commit210e0b7f861bb3bf94069a69bf53f5bc7f7ae4c7 (patch)
treeed6fb552c6cc20cd9c7b8139af33537194991dde /implementation/routing
parent2dc9af43fae8b5fc9f3d2517d3d3d7cd245aa7ac (diff)
downloadvSomeIP-210e0b7f861bb3bf94069a69bf53f5bc7f7ae4c7.tar.gz
Improved registration state update to application. Only do this if the
routing info signals a new state, not just because the proxy "thinks" it has entered a new state.
Diffstat (limited to 'implementation/routing')
-rw-r--r--implementation/routing/include/routing_manager_proxy.hpp1
-rw-r--r--implementation/routing/src/routing_manager_proxy.cpp13
2 files changed, 8 insertions, 6 deletions
diff --git a/implementation/routing/include/routing_manager_proxy.hpp b/implementation/routing/include/routing_manager_proxy.hpp
index 4659ccc..8819345 100644
--- a/implementation/routing/include/routing_manager_proxy.hpp
+++ b/implementation/routing/include/routing_manager_proxy.hpp
@@ -107,6 +107,7 @@ private:
boost::asio::io_service &io_;
bool is_connected_;
bool is_started_;
+ event_type_e state_;
routing_manager_host *host_;
client_t client_; // store locally as it is needed in each message
diff --git a/implementation/routing/src/routing_manager_proxy.cpp b/implementation/routing/src/routing_manager_proxy.cpp
index 8eacf8d..21216d1 100644
--- a/implementation/routing/src/routing_manager_proxy.cpp
+++ b/implementation/routing/src/routing_manager_proxy.cpp
@@ -29,7 +29,8 @@ namespace vsomeip {
routing_manager_proxy::routing_manager_proxy(routing_manager_host *_host) :
io_(_host->get_io()), host_(_host), client_(_host->get_client()), sender_(
0), receiver_(0), serializer_(std::make_shared<serializer>()), deserializer_(
- std::make_shared<deserializer>()), is_connected_(false), is_started_(false) {
+ std::make_shared<deserializer>()), is_connected_(false), is_started_(false),
+ state_(event_type_e::DEREGISTERED) {
}
routing_manager_proxy::~routing_manager_proxy() {
@@ -75,7 +76,6 @@ void routing_manager_proxy::start() {
if (is_connected_) {
register_application();
- host_->on_event(event_type_e::REGISTERED);
}
is_started_ = true;
@@ -83,7 +83,6 @@ void routing_manager_proxy::start() {
void routing_manager_proxy::stop() {
deregister_application();
- host_->on_event(event_type_e::DEREGISTERED);
if (receiver_)
receiver_->stop();
@@ -331,7 +330,6 @@ void routing_manager_proxy::on_connect(std::shared_ptr<endpoint> _endpoint) {
is_connected_ = (_endpoint == sender_);
if (is_connected_ && is_started_) {
register_application();
- host_->on_event(event_type_e::REGISTERED);
}
}
@@ -452,8 +450,11 @@ void routing_manager_proxy::on_routing_info(const byte_t *_data,
}
}
- // inform host about its own registration state
- host_->on_event(its_state);
+ // inform host about its own registration state changes
+ if (state_ != its_state) {
+ host_->on_event(its_state);
+ state_ = its_state;
+ }
// Check for services that are no longer available
for (auto i : old_local_services) {