summaryrefslogtreecommitdiff
path: root/examples/subscribe-sample.cpp
diff options
context:
space:
mode:
authorJürgen Gehring <juergen.gehring@bmw.de>2015-07-29 00:39:43 -0700
committerJürgen Gehring <juergen.gehring@bmw.de>2015-07-29 00:39:43 -0700
commit4792b52c653ab8cdba740a141ae808226b3ed2c1 (patch)
tree47ba024655b6491de0f8e3033ec99fc35080d5f4 /examples/subscribe-sample.cpp
parenta1082eaf77850fe213e30e9abc4ea709d0499681 (diff)
downloadvSomeIP-4792b52c653ab8cdba740a141ae808226b3ed2c1.tar.gz
vSomeIP 1.3.01.3.0
Diffstat (limited to 'examples/subscribe-sample.cpp')
-rw-r--r--examples/subscribe-sample.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/subscribe-sample.cpp b/examples/subscribe-sample.cpp
index acf9790..3faa4d1 100644
--- a/examples/subscribe-sample.cpp
+++ b/examples/subscribe-sample.cpp
@@ -1,5 +1,4 @@
-// Copyright (C) 2014 BMW Group
-// Author: Lutz Bichler (lutz.bichler@bmw.de)
+// Copyright (C) 2014-2015 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/.
@@ -55,7 +54,7 @@ public:
}
}
- void on_message(std::shared_ptr<vsomeip::message> &_response) {
+ void on_message(const std::shared_ptr<vsomeip::message> &_response) {
std::stringstream its_message;
its_message << "Received a notification for Event [" << std::setw(4)
<< std::setfill('0') << std::hex << _response->get_service()
@@ -80,7 +79,8 @@ public:
its_get->set_service(SAMPLE_SERVICE_ID);
its_get->set_instance(SAMPLE_INSTANCE_ID);
its_get->set_method(SAMPLE_GET_METHOD_ID);
- app_->send(its_get, true, use_tcp_);
+ its_get->set_reliable(use_tcp_);
+ app_->send(its_get, true);
}
if ((its_payload->get_length() % 8) == 0) {
@@ -89,6 +89,7 @@ public:
its_set->set_service(SAMPLE_SERVICE_ID);
its_set->set_instance(SAMPLE_INSTANCE_ID);
its_set->set_method(SAMPLE_SET_METHOD_ID);
+ its_set->set_reliable(use_tcp_);
const vsomeip::byte_t its_data[]
= { 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
@@ -97,7 +98,7 @@ public:
= vsomeip::runtime::get()->create_payload();
its_set_payload->set_data(its_data, sizeof(its_data));
its_set->set_payload(its_set_payload);
- app_->send(its_set, true, use_tcp_);
+ app_->send(its_set, true);
}
}
}