Skip to content

Commit

Permalink
vsomeip 2.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
juergengehring committed Jan 25, 2018
1 parent 686cb94 commit 6cf4dc4
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 26 deletions.
10 changes: 10 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changes
=======

v2.9.1
- Don't ignore service requests for UDP-only remote services done
before corresponding OfferService message was received.
- Ensure that main dispatcher thread waits until newly started
dispatcher threads are finished with their call into the user code
before starting to dispatch again after a blocking call occurred.

v2.9.0
- Added get_offered_services_async method to application interface to
read the currently offered services
Expand All @@ -13,6 +20,9 @@ v2.9.0
- Incoming subscriptions are now not acknowledged if not all events of
the eventgroup can be served with the given endpoint options.

v2.8.1
- Support negative filter in trace connector

v2.8.0
- Change behaviour of register_subscription_status_handler method of
the application interface: Registered handlers will only be called
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project (vsomeip)

set (VSOMEIP_MAJOR_VERSION 2)
set (VSOMEIP_MINOR_VERSION 9)
set (VSOMEIP_PATCH_VERSION 0)
set (VSOMEIP_PATCH_VERSION 1)
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)
Expand Down Expand Up @@ -138,14 +138,14 @@ if (MSVC)
message("using MSVC Compiler")
# add_definitions(-DVSOMEIP_DLL_COMPILATION) now it is controlled per target
SET(BOOST_WINDOWS_VERSION "0x600" CACHE STRING "Set the same Version as the Version with which Boost was built, otherwise there will be errors. (normaly 0x600 is for Windows 7 and 0x501 is for Windows XP)")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=${BOOST_WINDOWS_VERSION} -DWIN32 -DUSE_VSOMEIP_STATISTICS -DCOMMONAPI_INTERNAL_COMPILATION -DBOOST_LOG_DYN_LINK -DBOOST_ASIO_DISABLE_IOCP /EHsc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=${BOOST_WINDOWS_VERSION} -DWIN32 -DUSE_VSOMEIP_STATISTICS -DCOMMONAPI_INTERNAL_COMPILATION -DBOOST_LOG_DYN_LINK -DBOOST_ASIO_DISABLE_IOCP /EHsc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=${BOOST_WINDOWS_VERSION} -DWIN32 -DBOOST_LOG_DYN_LINK -DBOOST_ASIO_DISABLE_IOCP /EHsc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_WIN32_WINNT=${BOOST_WINDOWS_VERSION} -DWIN32 -DBOOST_LOG_DYN_LINK -DBOOST_ASIO_DISABLE_IOCP /EHsc")
set(USE_RT "")
set(Boost_LIBRARIES "")
link_directories(${Boost_LIBRARY_DIR_DEBUG})
ADD_DEFINITIONS( -DBOOST_ALL_DYN_LINK )
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${OS} ${OS_CXX_FLAGS} -DUSE_VSOMEIP_STATISTICS -DBOOST_LOG_DYN_LINK -g ${OPTIMIZE} -std=c++0x ${NO_DEPRECATED} ${EXPORTSYMBOLS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${OS} ${OS_CXX_FLAGS} -DBOOST_LOG_DYN_LINK -g ${OPTIMIZE} -std=c++0x ${NO_DEPRECATED} ${EXPORTSYMBOLS}")
set(USE_RT "rt")
endif()

Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/hello_world_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class hello_world_service {

// Send the response back
app_->send(resp, true);
// we're finished stop now
// we have finished
terminate();
}

Expand Down
2 changes: 1 addition & 1 deletion implementation/configuration/include/internal.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#define VSOMEIP_DEFAULT_CONFIGURATION_FILE "/etc/vsomeip.json"
#define VSOMEIP_LOCAL_CONFIGURATION_FILE "./vsomeip.json"
#define VSOMEIP_MANDATORY_CONFIGURATION_FILES "vsomeip_std.json,vsomeip_app.json,vsomeip_plc.json"
#define VSOMEIP_MANDATORY_CONFIGURATION_FILES "vsomeip_std.json,vsomeip_app.json,vsomeip_plc.json,vsomeip_log.json"

#define VSOMEIP_DEFAULT_CONFIGURATION_FOLDER "/etc/vsomeip"
#define VSOMEIP_LOCAL_CONFIGURATION_FOLDER "./vsomeip"
Expand Down
2 changes: 0 additions & 2 deletions implementation/routing/include/routing_manager_proxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ class routing_manager_proxy: public routing_manager_base {
std::map<client_t, std::set<subscription_data_t>> pending_incoming_subscripitons_;
std::mutex incoming_subscripitons_mutex_;

std::mutex deserialize_mutex_;

std::mutex state_mutex_;
std::condition_variable state_condition_;

Expand Down
25 changes: 25 additions & 0 deletions implementation/routing/src/routing_manager_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,31 @@ void routing_manager_impl::add_routing_info(
std::lock_guard<std::recursive_mutex> its_lock(endpoint_mutex_);
remote_service_info_[_service][_instance][false] = endpoint_def;
}
// check if service was requested and increase requester count if necessary
{
std::lock_guard<std::mutex> its_lock(requested_services_mutex_);
for (const auto &client_id : requested_services_) {
const auto found_service = client_id.second.find(_service);
if (found_service != client_id.second.end()) {
const auto found_instance = found_service->second.find(
_instance);
if (found_instance != found_service->second.end()) {
for (const auto &major_minor_pair : found_instance->second) {
if ((major_minor_pair.first == _major
|| _major == DEFAULT_MAJOR
|| major_minor_pair.first == ANY_MAJOR)
&& (major_minor_pair.second <= _minor
|| _minor == DEFAULT_MINOR
|| major_minor_pair.second
== ANY_MINOR)) {
its_info->add_client(client_id.first);
break;
}
}
}
}
}
}
}
if (!is_reliable_known) {
on_availability(_service, _instance, true, _major, _minor);
Expand Down
17 changes: 14 additions & 3 deletions implementation/runtime/src/application_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,17 +1455,18 @@ routing_manager * application_impl::get_routing_manager() const {
}

void application_impl::main_dispatch() {
const std::thread::id its_id = std::this_thread::get_id();
std::unique_lock<std::mutex> its_lock(handlers_mutex_);
while (is_dispatching_) {
if (handlers_.empty()) {
if (handlers_.empty() || !is_active_dispatcher(its_id)) {
// Cancel other waiting dispatcher
dispatcher_condition_.notify_all();
// Wait for new handlers to execute
while (handlers_.empty() && is_dispatching_) {
while (is_dispatching_ && (handlers_.empty() || !is_active_dispatcher(its_id))) {
dispatcher_condition_.wait(its_lock);
}
} else {
while (is_dispatching_ && !handlers_.empty()) {
while (is_dispatching_ && !handlers_.empty() && is_active_dispatcher(its_id)) {
std::shared_ptr<sync_handler> its_handler = handlers_.front();
handlers_.pop_front();
its_lock.unlock();
Expand All @@ -1483,6 +1484,12 @@ void application_impl::main_dispatch() {
}
}
}
// application was stopped
{
std::lock_guard<std::mutex> its_lock(dispatcher_mutex_);
dispatchers_.erase(its_id);
}
remove_elapsed_dispatchers();
its_lock.unlock();
}

Expand Down Expand Up @@ -1510,6 +1517,10 @@ void application_impl::dispatch() {
}
}
}
{
std::lock_guard<std::mutex> its_lock(handlers_mutex_);
dispatcher_condition_.notify_all();
}
{
std::lock_guard<std::mutex> its_lock(dispatcher_mutex_);
elapsed_dispatchers_.insert(its_id);
Expand Down
26 changes: 11 additions & 15 deletions implementation/tracing/src/trace_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,24 +295,23 @@ bool trace_connector::apply_filter_rules(const byte_t *_data, uint16_t _data_si
filter_rule_t its_filter_rule = it_filter_rules->second;

// apply filter rule
bool filter_rule_matches = false;
bool trace_message = true;
filter_type_e its_filter_type = its_filter_rule.first;
for(auto it_filter_rule_map = its_filter_rule.second.begin();
it_filter_rule_map != its_filter_rule.second.end();
it_filter_rule_map != its_filter_rule.second.end() && trace_message;
++it_filter_rule_map) {

filter_criteria_e its_criteria = it_filter_rule_map->first;
auto &its_filter_expressions = it_filter_rule_map->second;

// check if filter expressions of filter criteria match
filter_rule_matches = filter_expressions_match(its_criteria, its_filter_expressions, _data, _data_size) == (int)its_filter_type;
if(!filter_rule_matches) {
// filter expressions of filter criteria does not match
break;
if(its_filter_expressions.size() != 0) {
// check if filter expressions of filter criteria match
const bool filter_rule_matches = filter_expressions_match(its_criteria, its_filter_expressions, _data, _data_size);
trace_message = !(filter_rule_matches && its_filter_type == filter_type_e::NEGATIVE);
}
}

if(filter_rule_matches) {
if(trace_message) {
//filter rule matches -> send message over 'its_channel' to DLT
_send_msg_over_channels.push_back(its_channel);
}
Expand Down Expand Up @@ -361,20 +360,17 @@ bool trace_connector::filter_expressions_match(

// if extraction is successful, filter
if (is_successful) {
bool filter_expressions_matches = true;
bool filter_expressions_matches = false;
for (auto it_expressions = _expressions.begin();
it_expressions != _expressions.end();
it_expressions != _expressions.end() && !filter_expressions_matches;
++it_expressions) {
filter_expression_t its_filter_expression = *it_expressions;
uint16_t its_message_value = 0;


its_message_value = (uint16_t)((its_message_value << 8) + first);
its_message_value = (uint16_t)((its_message_value << 8) + second);
if(its_filter_expression != its_message_value) {
filter_expressions_matches = false;
break;
}

filter_expressions_matches = (its_filter_expression == its_message_value);
}
return filter_expressions_matches;
}
Expand Down

0 comments on commit 6cf4dc4

Please sign in to comment.