Skip to content

Commit 46e6856

Browse files
committed
vsomeip 3.1.16.1
1 parent 3ccf1c6 commit 46e6856

30 files changed

+94
-1353
lines changed

Android.bp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ libvsomeip_srcs = [
88
"implementation/utility/**/*.cpp",
99
"implementation/plugin/**/*.cpp",
1010
"implementation/security/**/*.cpp",
11+
"implementation/logger/**/*.cpp",
1112
]
1213

1314
libvsomeip_cfg_srcs = [
@@ -33,6 +34,7 @@ cc_defaults {
3334
"-Wno-unused-private-field",
3435
"-Wno-unused-lambda-capture",
3536
"-Wno-unused-variable",
37+
"-Wno-unused-local-typedef",
3638
"-Wno-sign-compare",
3739
"-Wno-format",
3840
"-Wno-header-guard",
@@ -42,7 +44,7 @@ cc_defaults {
4244
}
4345

4446
cc_library_shared {
45-
name: "libvsomeip",
47+
name: "libvsomeip3",
4648
vendor: true,
4749

4850
srcs: libvsomeip_srcs,
@@ -76,7 +78,7 @@ cc_library_shared {
7678
}
7779

7880
cc_library_shared {
79-
name: "libvsomeip_cfg",
81+
name: "libvsomeip3-cfg",
8082
vendor: true,
8183

8284
srcs: libvsomeip_cfg_srcs,
@@ -93,14 +95,14 @@ cc_library_shared {
9395
],
9496

9597
shared_libs: [
96-
"libvsomeip",
98+
"libvsomeip3",
9799
"libboost_system",
98100
"libboost_filesystem"
99101
]
100102
}
101103

102104
cc_library_shared {
103-
name: "libvsomeip_e2e",
105+
name: "libvsomeip3-e2e",
104106
vendor: true,
105107

106108
srcs: libvsomeip_e2e_srcs,
@@ -117,12 +119,12 @@ cc_library_shared {
117119
],
118120

119121
shared_libs: [
120-
"libvsomeip"
122+
"libvsomeip3"
121123
]
122124
}
123125

124126
cc_library_shared {
125-
name: "libvsomeip_sd",
127+
name: "libvsomeip3-sd",
126128
vendor: true,
127129

128130
srcs: libvsomeip_sd_srcs,
@@ -139,6 +141,7 @@ cc_library_shared {
139141
],
140142

141143
shared_libs: [
142-
"libvsomeip"
144+
"libvsomeip3",
145+
"libboost_thread"
143146
]
144147
}

CHANGES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changes
22
=======
33

4+
v3.1.16.1
5+
- Restore IPv6 within UDP server endpoint
6+
- AOSP build adaptation to vsomeip3 libraries
7+
8+
v3.1.16
9+
- Fixed race condition when leaving multicast group
10+
- Do not busy loop when receiving garbage data on local endpoint
11+
412
v3.1.15
513
- Ensure to remove the correct subscription object on unsubscribe
614
- Implemented support to define "secure services"

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ set (VSOMEIP_COMPAT_NAME vsomeip)
1111

1212
set (VSOMEIP_MAJOR_VERSION 3)
1313
set (VSOMEIP_MINOR_VERSION 1)
14-
set (VSOMEIP_PATCH_VERSION 15)
14+
set (VSOMEIP_PATCH_VERSION 16)
1515
set (VSOMEIP_HOTFIX_VERSION 1)
1616

17-
1817
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
1918
set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentation/doxygen.in
2019
set (CMAKE_VERBOSE_MAKEFILE off)

examples/hello_world/Android.bp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ cc_defaults {
88
],
99

1010
shared_libs: [
11-
"libvsomeip",
12-
"libvsomeip_cfg",
13-
"libvsomeip_e2e",
14-
"libvsomeip_sd",
11+
"libvsomeip3",
12+
"libvsomeip3-cfg",
13+
"libvsomeip3-e2e",
14+
"libvsomeip3-sd",
15+
"liblog",
1516
],
1617
}
1718

@@ -20,7 +21,7 @@ cc_binary {
2021
defaults: ["vsomeip_hello_world_defaults"],
2122

2223
srcs: [
23-
"hello_world_service.cpp",
24+
"hello_world_service_main.cpp",
2425
],
2526
}
2627

@@ -29,12 +30,13 @@ cc_binary {
2930
defaults: ["vsomeip_hello_world_defaults"],
3031

3132
srcs: [
32-
"hello_world_client.cpp",
33+
"hello_world_client_main.cpp",
3334
],
3435
}
3536

3637
prebuilt_etc {
3738
name: "helloworld-local.json",
39+
vendor: true,
3840
sub_dir: "vsomeip",
3941
src: "helloworld-local.json",
4042
}

examples/hello_world/hello_world_client.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
55
#include <vsomeip/vsomeip.hpp>
66

7-
#ifdef __ANDROID__ // NDK
7+
#if defined ANDROID || defined __ANDROID__
88
#include "android/log.h"
99
#define LOG_TAG "hello_world_client"
10-
#define LOG_INF(...) (void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, ##__VA_ARGS__)
11-
#define LOG_ERR(...) (void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, ##__VA_ARGS__)
10+
#define LOG_INF(...) fprintf(stdout, __VA_ARGS__), fprintf(stdout, "\n"), (void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, ##__VA_ARGS__)
11+
#define LOG_ERR(...) fprintf(stderr, __VA_ARGS__), fprintf(stderr, "\n"), (void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, ##__VA_ARGS__)
1212
#else
1313
#include <cstdio>
14-
#define LOG_INF(...) fprintf(stdout, __VA_ARGS__)
15-
#define LOG_ERR(...) fprintf(stderr, __VA_ARGS__)
14+
#define LOG_INF(...) fprintf(stdout, __VA_ARGS__), fprintf(stdout, "\n")
15+
#define LOG_ERR(...) fprintf(stderr, __VA_ARGS__), fprintf(stderr, "\n")
1616
#endif
1717

1818
static vsomeip::service_t service_id = 0x1111;

examples/hello_world/hello_world_service.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
#include <condition_variable>
99
#include <mutex>
1010

11-
#ifdef __ANDROID__ // NDK
11+
#if defined ANDROID || defined __ANDROID__
1212
#include "android/log.h"
1313
#define LOG_TAG "hello_world_service"
14-
#define LOG_INF(...) (void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, ##__VA_ARGS__)
15-
#define LOG_ERR(...) (void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, ##__VA_ARGS__)
14+
#define LOG_INF(...) fprintf(stdout, __VA_ARGS__), fprintf(stdout, "\n"), (void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, ##__VA_ARGS__)
15+
#define LOG_ERR(...) fprintf(stderr, __VA_ARGS__), fprintf(stderr, "\n"), (void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, ##__VA_ARGS__)
1616
#else
1717
#include <cstdio>
18-
#define LOG_INF(...) fprintf(stdout, __VA_ARGS__)
19-
#define LOG_ERR(...) fprintf(stderr, __VA_ARGS__)
18+
#define LOG_INF(...) fprintf(stdout, __VA_ARGS__), fprintf(stdout, "\n")
19+
#define LOG_ERR(...) fprintf(stderr, __VA_ARGS__), fprintf(stderr, "\n")
2020
#endif
2121

2222
static vsomeip::service_t service_id = 0x1111;

examples/hello_world/readme_android

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
AOSP:
22
1. Apply vsomeip project to AOSP tree and build hello_world example (e.g. via mma build command)
33
2. Push changes to target
4-
3. Start service and client via different adb shell sessions:
4+
3. Start service and client via different adb shell sessions under root user:
55

66
Shell1:
7-
VSOMEIP_CONFIGURATION=/etc/vsomeip/helloworld-local.json \
7+
VSOMEIP_CONFIGURATION=/vendor/etc/vsomeip/helloworld-local.json \
88
VSOMEIP_APPLICATION_NAME=hello_world_service \
99
vsomeip_hello_world_service
1010

1111
Shell2:
12-
VSOMEIP_CONFIGURATION=/etc/vsomeip/helloworld-local.json \
12+
VSOMEIP_CONFIGURATION=/vendor/etc/vsomeip/helloworld-local.json \
1313
VSOMEIP_APPLICATION_NAME=hello_world_client \
1414
vsomeip_hello_world_client
1515

implementation/configuration/include/internal_android.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
#define VSOMEIP_MAX_DISPATCHERS 10
6868
#define VSOMEIP_MAX_DISPATCH_TIME 100
6969

70-
#define VSOMEIP_MAX_DESERIALIZER 5
71-
7270
#define VSOMEIP_REQUEST_DEBOUNCE_TIME 10
7371

7472
#define VSOMEIP_MAX_WAIT_SENT 5

implementation/endpoints/src/endpoint_manager_impl.cpp

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -412,35 +412,42 @@ void endpoint_manager_impl::find_or_create_multicast_endpoint(
412412
}
413413

414414
void endpoint_manager_impl::clear_multicast_endpoints(service_t _service, instance_t _instance) {
415-
std::lock_guard<std::recursive_mutex> its_lock(endpoint_mutex_);
416-
// Clear multicast info and endpoint and multicast instance (remote service)
417-
if (multicast_info.find(_service) != multicast_info.end()) {
418-
if (multicast_info[_service].find(_instance) != multicast_info[_service].end()) {
419-
std::string address = multicast_info[_service][_instance]->get_address().to_string();
420-
uint16_t port = multicast_info[_service][_instance]->get_port();
421-
std::shared_ptr<endpoint> multicast_endpoint;
422-
auto found_port = server_endpoints_.find(port);
423-
if (found_port != server_endpoints_.end()) {
424-
auto found_unreliable = found_port->second.find(false);
425-
if (found_unreliable != found_port->second.end()) {
426-
multicast_endpoint = found_unreliable->second;
427-
dynamic_cast<udp_server_endpoint_impl*>(
428-
multicast_endpoint.get())->leave(address);
429-
multicast_endpoint->stop();
430-
server_endpoints_[port].erase(false);
415+
416+
std::shared_ptr<endpoint> multicast_endpoint;
417+
std::string address;
418+
419+
{
420+
std::lock_guard<std::recursive_mutex> its_lock(endpoint_mutex_);
421+
// Clear multicast info and endpoint and multicast instance (remote service)
422+
if (multicast_info.find(_service) != multicast_info.end()) {
423+
if (multicast_info[_service].find(_instance) != multicast_info[_service].end()) {
424+
address = multicast_info[_service][_instance]->get_address().to_string();
425+
uint16_t port = multicast_info[_service][_instance]->get_port();
426+
auto found_port = server_endpoints_.find(port);
427+
if (found_port != server_endpoints_.end()) {
428+
auto found_unreliable = found_port->second.find(false);
429+
if (found_unreliable != found_port->second.end()) {
430+
multicast_endpoint = found_unreliable->second;
431+
server_endpoints_[port].erase(false);
432+
}
433+
if (found_port->second.find(true) == found_port->second.end()) {
434+
server_endpoints_.erase(port);
435+
}
431436
}
432-
if (found_port->second.find(true) == found_port->second.end()) {
433-
server_endpoints_.erase(port);
437+
multicast_info[_service].erase(_instance);
438+
if (0 >= multicast_info[_service].size()) {
439+
multicast_info.erase(_service);
434440
}
441+
// Clear service_instances_ for multicast endpoint
442+
(void)remove_instance(_service, multicast_endpoint.get());
435443
}
436-
multicast_info[_service].erase(_instance);
437-
if (0 >= multicast_info[_service].size()) {
438-
multicast_info.erase(_service);
439-
}
440-
// Clear service_instances_ for multicast endpoint
441-
remove_instance(_service, multicast_endpoint.get());
442444
}
443445
}
446+
if (multicast_endpoint) {
447+
dynamic_cast<udp_server_endpoint_impl*>(
448+
multicast_endpoint.get())->leave(address);
449+
multicast_endpoint->stop();
450+
}
444451
}
445452

446453
bool endpoint_manager_impl::supports_selective(service_t _service,

implementation/endpoints/src/local_server_endpoint_impl.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ void local_server_endpoint_impl::connection::receive_cbk(
554554
return;
555555
}
556556

557+
bool is_error(false);
557558
std::size_t its_start = 0;
558559
std::size_t its_end = 0;
559560
std::size_t its_iteration_gap = 0;
@@ -757,13 +758,17 @@ void local_server_endpoint_impl::connection::receive_cbk(
757758
missing_capacity_ <= recv_buffer_.capacity() - recv_buffer_size_) {
758759
missing_capacity_ = 0;
759760
}
761+
} else if (message_is_empty) {
762+
VSOMEIP_ERROR << "Received garbage data.";
763+
is_error = true;
760764
}
761765
}
762766
} while (recv_buffer_size_ > 0 && found_message);
763767
}
764768

765769
if (_error == boost::asio::error::eof
766-
|| _error == boost::asio::error::connection_reset) {
770+
|| _error == boost::asio::error::connection_reset
771+
|| is_error) {
767772
stop();
768773
its_server->remove_connection(bound_client_);
769774
security::get()->remove_client_to_uid_gid_mapping(bound_client_);

0 commit comments

Comments
 (0)