summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--examples/hello_world/CMakeLists.txt2
-rw-r--r--examples/hello_world/hello_world_client.cpp2
-rw-r--r--examples/hello_world/hello_world_service.cpp2
-rw-r--r--examples/hello_world/helloworld-local.json69
-rw-r--r--examples/hello_world/readme2
-rw-r--r--examples/notify-sample.cpp2
-rw-r--r--examples/readme.txt10
-rw-r--r--examples/request-sample.cpp2
-rw-r--r--examples/response-sample.cpp2
-rw-r--r--examples/sample-ids.hpp2
-rw-r--r--examples/subscribe-sample.cpp12
12 files changed, 56 insertions, 53 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index e419589..aca749c 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+# Copyright (C) 2015-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/hello_world/CMakeLists.txt b/examples/hello_world/CMakeLists.txt
index 48d14a4..cb32665 100644
--- a/examples/hello_world/CMakeLists.txt
+++ b/examples/hello_world/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+# Copyright (C) 2015-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/hello_world/hello_world_client.cpp b/examples/hello_world/hello_world_client.cpp
index 2099eee..8007c32 100644
--- a/examples/hello_world/hello_world_client.cpp
+++ b/examples/hello_world/hello_world_client.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2015-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/hello_world/hello_world_service.cpp b/examples/hello_world/hello_world_service.cpp
index 78b895f..b99a401 100644
--- a/examples/hello_world/hello_world_service.cpp
+++ b/examples/hello_world/hello_world_service.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2015-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/hello_world/helloworld-local.json b/examples/hello_world/helloworld-local.json
index c2b4203..5aeebb7 100644
--- a/examples/hello_world/helloworld-local.json
+++ b/examples/hello_world/helloworld-local.json
@@ -1,43 +1,36 @@
{
- "unicast" : "134.86.56.94",
- "logging" :
- {
- "level" : "debug",
- "console" : "true"
- },
+ "unicast":"134.86.56.94",
+ "logging":
+ {
+ "level":"debug",
+ "console":"true"
+ },
- "applications" :
- [
- {
- "name" : "hello_world_service",
- "id" : "0x4444"
- },
+ "applications":
+ [
+ {
+ "name":"hello_world_service",
+ "id":"0x4444"
+ },
- {
- "name" : "hello_world_client",
- "id" : "0x5555"
- }
- ],
+ {
+ "name":"hello_world_client",
+ "id":"0x5555"
+ }
+ ],
- "servicegroups" :
- [
- {
- "name" : "default",
- "unicast" : "local",
- "services" :
- [
- {
- "service" : "0x1111",
- "instance" : "0x2222",
- "unreliable" : "30509"
- }
- ]
- }
- ],
+ "services":
+ [
+ {
+ "service":"0x1111",
+ "instance":"0x2222",
+ "unreliable":"30509"
+ }
+ ],
- "routing" : "hello_world_service",
- "service-discovery" :
- {
- "enable" : "false"
- }
-} \ No newline at end of file
+ "routing":"hello_world_service",
+ "service-discovery":
+ {
+ "enable":"false"
+ }
+}
diff --git a/examples/hello_world/readme b/examples/hello_world/readme
index 9b19424..01c2ec9 100644
--- a/examples/hello_world/readme
+++ b/examples/hello_world/readme
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+# Copyright (C) 2015-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/notify-sample.cpp b/examples/notify-sample.cpp
index 442f74b..12c9a4c 100644
--- a/examples/notify-sample.cpp
+++ b/examples/notify-sample.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/readme.txt b/examples/readme.txt
index 745c5f2..038544e 100644
--- a/examples/readme.txt
+++ b/examples/readme.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+# Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -8,10 +8,10 @@ the configuration files need to be adapted to match the devices addresses.
To start the request/response-example from the build-directory do:
-HOST1: env VSOMEIP_CONFIGURATION=../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./request-sample
-HOST2: env VSOMEIP_CONFIGURATION=../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./response-sample
+HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./request-sample
+HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./response-sample
To start the subscribe/notify-example from the build-directory do:
-HOST1: env VSOMEIP_CONFIGURATION=../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./subscribe-sample
-HOST2: env VSOMEIP_CONFIGURATION=../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./notify-sample
+HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=client-sample ./subscribe-sample
+HOST1: env VSOMEIP_CONFIGURATION=../../config/vsomeip-local.json VSOMEIP_APPLICATION_NAME=service-sample ./notify-sample
diff --git a/examples/request-sample.cpp b/examples/request-sample.cpp
index ccdcffe..86834d0 100644
--- a/examples/request-sample.cpp
+++ b/examples/request-sample.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/response-sample.cpp b/examples/response-sample.cpp
index 31adace..c3ef177 100644
--- a/examples/response-sample.cpp
+++ b/examples/response-sample.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/sample-ids.hpp b/examples/sample-ids.hpp
index 2d59164..b1a503d 100644
--- a/examples/sample-ids.hpp
+++ b/examples/sample-ids.hpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/examples/subscribe-sample.cpp b/examples/subscribe-sample.cpp
index 9a03722..915ea11 100644
--- a/examples/subscribe-sample.cpp
+++ b/examples/subscribe-sample.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -29,6 +29,10 @@ public:
<< "]"
<< std::endl;
+ app_->register_state_handler(
+ std::bind(&client_sample::on_state, this,
+ std::placeholders::_1));
+
app_->register_message_handler(
vsomeip::ANY_SERVICE, SAMPLE_INSTANCE_ID, vsomeip::ANY_METHOD,
std::bind(&client_sample::on_message, this,
@@ -53,6 +57,12 @@ public:
app_->start();
}
+ void on_state(vsomeip::state_type_e _state) {
+ if (_state == vsomeip::state_type_e::ST_REGISTERED) {
+ app_->request_service(SAMPLE_SERVICE_ID, SAMPLE_INSTANCE_ID);
+ }
+ }
+
void on_availability(vsomeip::service_t _service, vsomeip::instance_t _instance, bool _is_available) {
std::cout << "Service ["
<< std::setw(4) << std::setfill('0') << std::hex << _service << "." << _instance