diff options
author | Diogo Pedrosa <48529452+DiogoPedrozza@users.noreply.github.com> | 2023-03-13 14:09:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 14:09:12 +0000 |
commit | 1b427801352b5dcfdc2277f6343166c01afe97d6 (patch) | |
tree | d4e984dd100f3257ce784c9e30aefb6e60a93ab5 /examples/notify-sample.cpp | |
parent | fc73f40fa1501dc53210c63cb7c0d7623d106370 (diff) | |
parent | 826ebb8d352245a36ecaec32b6af61e7abf4696e (diff) | |
download | vSomeIP-1b427801352b5dcfdc2277f6343166c01afe97d6.tar.gz |
Merge pull request #416 from COVESA/update_3.3.03.3.0
vsomeip 3.3.0
Diffstat (limited to 'examples/notify-sample.cpp')
-rw-r--r-- | examples/notify-sample.cpp | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/examples/notify-sample.cpp b/examples/notify-sample.cpp index 0b9ed52..2aafa9d 100644 --- a/examples/notify-sample.cpp +++ b/examples/notify-sample.cpp @@ -19,10 +19,9 @@ class service_sample { public: - service_sample(bool _use_tcp, uint32_t _cycle) : + service_sample(uint32_t _cycle) : app_(vsomeip::runtime::get()->create_application()), is_registered_(false), - use_tcp_(_use_tcp), cycle_(_cycle), blocked_(false), running_(true), @@ -166,12 +165,6 @@ public: } void notify() { - std::shared_ptr<vsomeip::message> its_message - = vsomeip::runtime::get()->create_request(use_tcp_); - - its_message->set_service(SAMPLE_SERVICE_ID); - its_message->set_instance(SAMPLE_INSTANCE_ID); - its_message->set_method(SAMPLE_SET_METHOD_ID); vsomeip::byte_t its_data[10]; uint32_t its_size = 1; @@ -205,7 +198,6 @@ public: private: std::shared_ptr<vsomeip::application> app_; bool is_registered_; - bool use_tcp_; uint32_t cycle_; std::mutex mutex_; @@ -235,23 +227,11 @@ private: #endif int main(int argc, char **argv) { - bool use_tcp = false; uint32_t cycle = 1000; // default 1s - std::string tcp_enable("--tcp"); - std::string udp_enable("--udp"); std::string cycle_arg("--cycle"); for (int i = 1; i < argc; i++) { - if (tcp_enable == argv[i]) { - use_tcp = true; - break; - } - if (udp_enable == argv[i]) { - use_tcp = false; - break; - } - if (cycle_arg == argv[i] && i + 1 < argc) { i++; std::stringstream converter; @@ -260,7 +240,7 @@ int main(int argc, char **argv) { } } - service_sample its_sample(use_tcp, cycle); + service_sample its_sample(cycle); #ifndef VSOMEIP_ENABLE_SIGNAL_HANDLING its_sample_ptr = &its_sample; signal(SIGINT, handle_signal); |