Commit 3aec01c4 authored by Juergen Gehring's avatar Juergen Gehring
Browse files

vsomeip 2.10.12

parent 2f0fdc59
Changes
=======
v2.10.12
- Fix exception handling for boost logger
v2.10.11
- Fix client ID handling for remote selective subscriptions
- Add handling for EDESTADDRREQ in endpoints
......
......@@ -8,7 +8,7 @@ project (vsomeip)
set (VSOMEIP_MAJOR_VERSION 2)
set (VSOMEIP_MINOR_VERSION 10)
set (VSOMEIP_PATCH_VERSION 11)
set (VSOMEIP_PATCH_VERSION 12)
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)
......
......@@ -12,6 +12,7 @@
#include <boost/log/utility/setup/console.hpp>
#include <boost/log/utility/setup/file.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
#include <boost/log/utility/exception_handler.hpp>
#include <boost/phoenix/bind/bind_member_function.hpp>
#include <boost/shared_ptr.hpp>
......@@ -65,7 +66,7 @@ logger_impl::get_internal() {
void logger_impl::init(const std::shared_ptr<configuration> &_configuration) {
get()->loglevel_ = _configuration->get_loglevel();
logging::core::get()->set_exception_handler(boost::log::make_exception_suppressor());
logging::core::get()->set_filter(
logging::trivial::severity >= get()->loglevel_);
......
......@@ -58,12 +58,12 @@ public:
void on_stop_offer_service(client_t _client, service_t _service,
instance_t _instance, major_version_t _major, minor_version_t _minor);
void send_subscribe(std::shared_ptr<vsomeip::endpoint> _target,
bool send_subscribe(std::shared_ptr<vsomeip::endpoint> _target,
client_t _client, service_t _service, instance_t _instance,
eventgroup_t _eventgroup, major_version_t _major,
event_t _event, pending_subscription_id_t _subscription_id);
void send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target,
bool send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target,
client_t _client, service_t _service,
instance_t _instance, eventgroup_t _eventgroup,
event_t _event, pending_subscription_id_t _unsubscription_id);
......
......@@ -1562,6 +1562,9 @@ bool routing_manager_impl::deliver_notification(
std::shared_ptr<event> its_event = find_event(_service, _instance, its_method);
if (its_event) {
if (!its_event->is_provided()) {
if (its_event->get_subscribers().size() == 0) {
return true; // as there is nothing to do
}
const uint32_t its_length(utility::get_payload_size(_data, _length));
std::shared_ptr<payload> its_payload
= runtime::get()->create_payload(&_data[VSOMEIP_PAYLOAD_POS],
......@@ -3489,8 +3492,13 @@ void routing_manager_impl::log_version_timer_cbk(boost::system::error_code const
#ifndef VSOMEIP_VERSION
#define VSOMEIP_VERSION "unknown version"
#endif
bool is_diag_mode(false);
VSOMEIP_INFO << "vSomeIP " << VSOMEIP_VERSION;
if (discovery_) {
is_diag_mode = discovery_->get_diagnosis_mode();
}
VSOMEIP_INFO << "vSomeIP " << VSOMEIP_VERSION << " | ("
<< ((is_diag_mode == true) ? "diagnosis)" : "default)");
{
std::lock_guard<std::mutex> its_lock(version_log_timer_mutex_);
version_log_timer_.expires_from_now(
......@@ -3914,7 +3922,8 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) {
switch (_routing_state) {
case vsomeip::routing_state_e::RS_SUSPENDED:
{
VSOMEIP_INFO << "set routing to suspend mode";
VSOMEIP_INFO << "Set routing to suspend mode, diagnosis mode is "
<< ((discovery_->get_diagnosis_mode() == true) ? "active." : "inactive.");
// stop processing of incoming SD messages
discovery_->stop();
......@@ -3958,7 +3967,8 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) {
}
case vsomeip::routing_state_e::RS_RESUMED:
{
VSOMEIP_INFO << "set routing to resume mode";
VSOMEIP_INFO << "Set routing to resume mode, diagnosis mode was "
<< ((discovery_->get_diagnosis_mode() == true) ? "active." : "inactive.");
// Reset relevant in service info
for (const auto &its_service : get_offered_services()) {
......@@ -3967,6 +3977,9 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) {
its_instance.second->set_is_in_mainphase(false);
}
}
// Switch SD back to normal operation
discovery_->set_diagnosis_mode(false);
// start processing of SD messages (incoming remote offers should lead to new subscribe messages)
discovery_->start();
......@@ -3981,10 +3994,10 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) {
}
case routing_state_e::RS_DIAGNOSIS:
{
VSOMEIP_INFO << "set routing to diagnosis mode";
VSOMEIP_INFO << "Set routing to diagnosis mode.";
discovery_->set_diagnosis_mode(true);
// send StopOffer messages for all someip protocal services
// send StopOffer messages for all someip protocol services
for (const auto &its_service : get_offered_services()) {
for (const auto &its_instance : its_service.second) {
if (host_->get_configuration()->is_someip(
......@@ -3998,7 +4011,8 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) {
break;
}
case routing_state_e::RS_RUNNING:
VSOMEIP_INFO << "set routing to running mode";
VSOMEIP_INFO << "Set routing to running mode, diagnosis mode was "
<< ((discovery_->get_diagnosis_mode() == true) ? "active." : "inactive.");
// Reset relevant in service info
for (const auto &its_service : get_offered_services()) {
......@@ -4512,10 +4526,21 @@ void routing_manager_impl::send_unsubscription(
}
);
} else {
stub_->send_unsubscribe(find_local(_offering_client),
if (!stub_->send_unsubscribe(find_local(_offering_client),
_subscribing_client,
_service, _instance, _eventgroup, ANY_EVENT,
_pending_unsubscription_id);
_pending_unsubscription_id)) {
try {
const auto its_callback = std::bind(
&routing_manager_stub_host::on_unsubscribe_ack,
std::dynamic_pointer_cast<routing_manager_stub_host>(shared_from_this()),
_offering_client, _service, _instance,
_eventgroup, _pending_unsubscription_id);
io_.post(its_callback);
} catch (const std::exception &e) {
VSOMEIP_ERROR << __func__ << e.what();
}
}
}
}
......@@ -4552,11 +4577,22 @@ void routing_manager_impl::send_subscription(
}
});
} else { // service hosted by local client
stub_->send_subscribe(find_local(_offering_client),
if (!stub_->send_subscribe(find_local(_offering_client),
_subscribing_client,
_service, _instance, _eventgroup,
_major, ANY_EVENT,
_pending_subscription_id);
_pending_subscription_id)) {
try {
const auto its_callback = std::bind(
&routing_manager_stub_host::on_subscribe_nack,
std::dynamic_pointer_cast<routing_manager_stub_host>(shared_from_this()),
_subscribing_client, _service, _instance,
_eventgroup, ANY_EVENT, _pending_subscription_id);
io_.post(its_callback);
} catch (const std::exception &e) {
VSOMEIP_ERROR << __func__ << e.what();
}
}
}
}
......
......@@ -349,7 +349,7 @@ void routing_manager_proxy::register_event(client_t _client,
pending_event_registrations_.insert(registration);
}
}
if (is_first) {
if (is_first || _is_provided) {
routing_manager_base::register_event(_client, _service, _instance,
_event,_eventgroups, _is_field,
_cycle, _change_resets_cycle,
......
......@@ -1224,7 +1224,7 @@ void routing_manager_stub::broadcast(const std::vector<byte_t> &_command) const
}
}
void routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _target,
bool routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _target,
client_t _client, service_t _service, instance_t _instance,
eventgroup_t _eventgroup, major_version_t _major,
event_t _event, pending_subscription_id_t _subscription_id) {
......@@ -1252,7 +1252,7 @@ void routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _ta
std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + 10],
&_subscription_id, sizeof(_subscription_id));
_target->send(its_command, sizeof(its_command));
return _target->send(its_command, sizeof(its_command));
} else {
VSOMEIP_WARNING << __func__ << " Couldn't send subscription to local client ["
<< std::hex << std::setw(4) << std::setfill('0') << _service << "."
......@@ -1261,10 +1261,11 @@ void routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _ta
<< std::hex << std::setw(4) << std::setfill('0') << _event << "]"
<< " subscriber: "<< std::hex << std::setw(4) << std::setfill('0')
<< _client;
return false;
}
}
void routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target,
bool routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target,
client_t _client, service_t _service, instance_t _instance,
eventgroup_t _eventgroup, event_t _event,
pending_subscription_id_t _unsubscription_id) {
......@@ -1288,7 +1289,7 @@ void routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _
std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + 8], &_unsubscription_id,
sizeof(_unsubscription_id));
_target->send(its_command, sizeof(its_command));
return _target->send(its_command, sizeof(its_command));
} else {
VSOMEIP_WARNING << __func__ << " Couldn't send unsubscription to local client ["
<< std::hex << std::setw(4) << std::setfill('0') << _service << "."
......@@ -1297,6 +1298,7 @@ void routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _
<< std::hex << std::setw(4) << std::setfill('0') << _event << "]"
<< " subscriber: "<< std::hex << std::setw(4) << std::setfill('0')
<< _client;
return false;
}
}
......
......@@ -6,6 +6,8 @@
#include <future>
#include <thread>
#include <iomanip>
#include <iostream>
#include <boost/log/exceptions.hpp>
#ifndef _WIN32
#include <dlfcn.h>
......@@ -352,6 +354,11 @@ void application_impl::start() {
<< std::this_thread::get_id();
try {
io_.run();
#ifndef _WIN32
} catch (const boost::log::v2_mt_posix::system_error &e) {
std::cerr << "catched boost::log system_error in I/O thread" << std::endl <<
boost::current_exception_diagnostic_information();
#endif
} catch (const std::exception &e) {
VSOMEIP_ERROR << "application_impl::start() "
"catched exception:" << e.what();
......@@ -384,6 +391,11 @@ void application_impl::start() {
<< name_ << ") is: " << std::hex << std::this_thread::get_id();
try {
io_.run();
#ifndef _WIN32
} catch (const boost::log::v2_mt_posix::system_error &e) {
std::cerr << "catched boost::log system_error in I/O thread" << std::endl <<
boost::current_exception_diagnostic_information();
#endif
} catch (const std::exception &e) {
VSOMEIP_ERROR << "application_impl::start() catched exception:" << e.what();
throw;
......@@ -1697,7 +1709,7 @@ void application_impl::invoke_handler(std::shared_ptr<sync_handler> &_handler) {
std::shared_ptr<sync_handler> its_sync_handler
= std::make_shared<sync_handler>(_handler->service_id_,
_handler->instance_id_, _handler->method_id_,
_handler->eventgroup_id_, _handler->session_id_,
_handler->session_id_, _handler->eventgroup_id_,
_handler->handler_type_);
boost::asio::steady_timer its_dispatcher_timer(io_);
......
......@@ -65,6 +65,9 @@ public:
std::shared_ptr<serviceinfo> _info) = 0;
virtual void set_diagnosis_mode(const bool _activate) = 0;
virtual bool get_diagnosis_mode() = 0;
virtual void remote_subscription_acknowledge(
service_t _service, instance_t _instance, eventgroup_t _eventgroup,
client_t _client, bool _accepted,
......
......@@ -96,6 +96,8 @@ public:
void set_diagnosis_mode(const bool _activate);
bool get_diagnosis_mode();
void remote_subscription_acknowledge(
service_t _service, instance_t _instance, eventgroup_t _eventgroup,
client_t _client, bool _acknowledged,
......
......@@ -1799,7 +1799,7 @@ bool service_discovery_impl::insert_offer_service(
}
} else {
if (!find_existing_option<ipv6_option_impl, ipv6_address_t>(_message,
unicast_.to_v6().to_bytes(), its_reliable->get_local_port(),
unicast_.to_v6().to_bytes(), its_unreliable->get_local_port(),
layer_four_protocol_e::UDP, option_type_e::IP6_ENDPOINT)) {
its_endpoint_size = VSOMEIP_SOMEIP_SD_IPV6_OPTION_SIZE;
}
......@@ -3310,6 +3310,10 @@ void service_discovery_impl::set_diagnosis_mode(const bool _activate) {
is_diagnosis_ = _activate;
}
bool service_discovery_impl::get_diagnosis_mode() {
return is_diagnosis_;
}
void service_discovery_impl::remote_subscription_acknowledge(
service_t _service, instance_t _instance, eventgroup_t _eventgroup,
client_t _client, bool _acknowledged,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment