summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 00:40:02 -0800
committerJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 00:40:02 -0800
commitba0508084244a2f226a6bdd42b02bbf83a7d7575 (patch)
tree866ea9a1d51070aa5311bb26b31605cf1eec68d6
parente20aff9795febe8d170e1e776f8b7a1b60d2b0cc (diff)
downloadvSomeIP-ba0508084244a2f226a6bdd42b02bbf83a7d7575.tar.gz
vsomeip 2.8.02.8.0
-rw-r--r--CHANGES8
-rw-r--r--CMakeLists.txt4
-rw-r--r--implementation/runtime/include/application_impl.hpp5
-rw-r--r--implementation/runtime/src/application_impl.cpp42
-rw-r--r--interface/vsomeip/application.hpp23
5 files changed, 70 insertions, 12 deletions
diff --git a/CHANGES b/CHANGES
index 9305bf4..65e7a03 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,14 @@
Changes
=======
+v2.8.0
+- Change behaviour of register_subscription_status_handler method of
+ the application interface: Registered handlers will only be called
+ if the subscription was accepted by the remote side.
+- Add 2nd register_subscription_status_handler method to application
+ interface with additional flag to enable calling of the registered
+ handler if the subscription is rejected by the remote side.
+
v.2.7.3
- Fix deadlock when stopping client endpoints to remote services
- Fix deadlock during construction of Subscribe Eventgroup entries
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1440c33..a46f34a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,8 @@ cmake_minimum_required (VERSION 2.8.12)
project (vsomeip)
set (VSOMEIP_MAJOR_VERSION 2)
-set (VSOMEIP_MINOR_VERSION 7)
-set (VSOMEIP_PATCH_VERSION 3)
+set (VSOMEIP_MINOR_VERSION 8)
+set (VSOMEIP_PATCH_VERSION 0)
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentatin/doxygen.in
set (CMAKE_VERBOSE_MAKEFILE off)
diff --git a/implementation/runtime/include/application_impl.hpp b/implementation/runtime/include/application_impl.hpp
index 45facc1..b03c497 100644
--- a/implementation/runtime/include/application_impl.hpp
+++ b/implementation/runtime/include/application_impl.hpp
@@ -171,6 +171,9 @@ public:
VSOMEIP_EXPORT void clear_all_handler();
+ VSOMEIP_EXPORT void register_subscription_status_handler(service_t _service,
+ instance_t _instance, eventgroup_t _eventgroup, event_t _event,
+ subscription_status_handler_t _handler, bool _is_selective);
private:
//
// Types
@@ -369,7 +372,7 @@ private:
bool stopped_called_;
std::map<service_t, std::map<instance_t, std::map<eventgroup_t,
- std::map<event_t, subscription_status_handler_t > > > > subscription_status_handlers_;
+ std::map<event_t, std::pair<subscription_status_handler_t, bool> > > > > subscription_status_handlers_;
std::mutex subscription_status_handlers_mutex_;
std::mutex subscriptions_state_mutex_;
diff --git a/implementation/runtime/src/application_impl.cpp b/implementation/runtime/src/application_impl.cpp
index bff1040..c776353 100644
--- a/implementation/runtime/src/application_impl.cpp
+++ b/implementation/runtime/src/application_impl.cpp
@@ -899,11 +899,15 @@ void application_impl::deliver_subscription_state(service_t _service, instance_t
if (found_eventgroup != found_instance->second.end()) {
auto found_event = found_eventgroup->second.find(_event);
if (found_event != found_eventgroup->second.end()) {
- handlers.push_back(found_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(found_event->second.first);
+ }
} else {
auto its_any_event = found_eventgroup->second.find(ANY_EVENT);
if (its_any_event != found_eventgroup->second.end()) {
- handlers.push_back(its_any_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(its_any_event->second.first);
+ }
}
}
}
@@ -914,11 +918,15 @@ void application_impl::deliver_subscription_state(service_t _service, instance_t
if (found_eventgroup != found_instance->second.end()) {
auto found_event = found_eventgroup->second.find(_event);
if (found_event != found_eventgroup->second.end()) {
- handlers.push_back(found_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(found_event->second.first);
+ }
} else {
auto its_any_event = found_eventgroup->second.find(ANY_EVENT);
if (its_any_event != found_eventgroup->second.end()) {
- handlers.push_back(its_any_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(its_any_event->second.first);
+ }
}
}
}
@@ -932,11 +940,15 @@ void application_impl::deliver_subscription_state(service_t _service, instance_t
if (found_eventgroup != found_instance->second.end()) {
auto found_event = found_eventgroup->second.find(_event);
if (found_event != found_eventgroup->second.end()) {
- handlers.push_back(found_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(found_event->second.first);
+ }
} else {
auto its_any_event = found_eventgroup->second.find(ANY_EVENT);
if (its_any_event != found_eventgroup->second.end()) {
- handlers.push_back(its_any_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(its_any_event->second.first);
+ }
}
}
}
@@ -947,11 +959,15 @@ void application_impl::deliver_subscription_state(service_t _service, instance_t
if (found_eventgroup != found_instance->second.end()) {
auto found_event = found_eventgroup->second.find(_event);
if (found_event != found_eventgroup->second.end()) {
- handlers.push_back(found_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(found_event->second.first);
+ }
} else {
auto its_any_event = found_eventgroup->second.find(ANY_EVENT);
if (its_any_event != found_eventgroup->second.end()) {
- handlers.push_back(its_any_event->second);
+ if (!_error || (_error && found_event->second.second)) {
+ handlers.push_back(its_any_event->second.first);
+ }
}
}
}
@@ -1017,9 +1033,17 @@ void application_impl::on_subscription_error(service_t _service,
void application_impl::register_subscription_status_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup, event_t _event,
subscription_status_handler_t _handler) {
+ register_subscription_status_handler(_service, _instance, _eventgroup,
+ _event, _handler, false);
+}
+
+void application_impl::register_subscription_status_handler(service_t _service,
+ instance_t _instance, eventgroup_t _eventgroup, event_t _event,
+ subscription_status_handler_t _handler, bool _is_selective) {
std::lock_guard<std::mutex> its_lock(subscription_status_handlers_mutex_);
if (_handler) {
- subscription_status_handlers_[_service][_instance][_eventgroup][_event] = _handler;
+ subscription_status_handlers_[_service][_instance][_eventgroup][_event] =
+ std::make_pair(_handler, _is_selective);
} else {
auto its_service = subscription_status_handlers_.find(_service);
if (its_service != subscription_status_handlers_.end()) {
diff --git a/interface/vsomeip/application.hpp b/interface/vsomeip/application.hpp
index f8591df..280957c 100644
--- a/interface/vsomeip/application.hpp
+++ b/interface/vsomeip/application.hpp
@@ -861,6 +861,29 @@ public:
virtual void register_subscription_status_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup, event_t _event,
subscription_status_handler_t _handler) = 0;
+
+ /**
+ *
+ * \brief Registers a subscription status listener.
+ *
+ * When registered such a handler it will be called for
+ * every application::subscribe call.
+ *
+ * This method is intended to replace the application::
+ * register_subscription_error_handler call in future releases.
+ *
+ * \param _service Service identifier of the service that is subscribed to.
+ * \param _instance Instance identifier of the service that is subscribed to.
+ * \param _eventgroup Eventgroup identifier of the eventgroup is subscribed to.
+ * \param _event Event indentifier of the event is subscribed to.
+ * \param _handler A subscription status handler which will be called by vSomeIP
+ * as a follow of application::subscribe.
+ * \param _is_selective Flag to enable calling the provided handler if the
+ * subscription is answered with a SUBSCRIBE_NACK.
+ */
+ virtual void register_subscription_status_handler(service_t _service,
+ instance_t _instance, eventgroup_t _eventgroup, event_t _event,
+ subscription_status_handler_t _handler, bool _is_selective) = 0;
};
/** @} */