From 23f71e2ebffc757015d849281e6d8900856ee05b Mon Sep 17 00:00:00 2001 From: Duarte Fonseca Date: Fri, 4 Oct 2024 17:33:32 +0100 Subject: [PATCH 1/6] Syncing network and COVESA changes --- .../endpoints/src/client_endpoint_impl.cpp | 33 +++--- .../endpoints/src/server_endpoint_impl.cpp | 9 +- implementation/logger/src/message.cpp | 22 ++-- .../routing/src/routing_manager_base.cpp | 10 +- .../routing/src/routing_manager_client.cpp | 68 ++++++------ .../routing/src/routing_manager_impl.cpp | 102 ++++++++++-------- .../runtime/src/application_impl.cpp | 3 +- .../src/service_discovery_impl.cpp | 24 +++-- .../application_test_client.cpp | 7 +- 9 files changed, 150 insertions(+), 128 deletions(-) diff --git a/implementation/endpoints/src/client_endpoint_impl.cpp b/implementation/endpoints/src/client_endpoint_impl.cpp index fe91ca949..1b8ed60de 100644 --- a/implementation/endpoints/src/client_endpoint_impl.cpp +++ b/implementation/endpoints/src/client_endpoint_impl.cpp @@ -565,10 +565,11 @@ void client_endpoint_impl::send_cbk( << _error.value() << ") " << get_remote_information() << " " << std::dec << queue_.size() << " " << std::dec << queue_size_ << " (" - << std::hex << std::setw(4) << std::setfill('0') << its_client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << its_service << "." - << std::hex << std::setw(4) << std::setfill('0') << its_method << "." - << std::hex << std::setw(4) << std::setfill('0') << its_session << "]" + << std::hex << std::setfill('0') + << std::setw(4) << its_client << "): [" + << std::setw(4) << its_service << "." + << std::setw(4) << its_method << "." + << std::setw(4) << its_session << "]"; << " endpoint > " << this << " socket state > " << static_cast(state_.load()); } } @@ -622,12 +623,13 @@ void client_endpoint_impl::send_cbk( VSOMEIP_WARNING << "cei::send_cbk received error: " << _error.message() << " (" << std::dec << _error.value() << ") " << get_remote_information() << " " - << " " << std::dec << queue_.size() - << " " << std::dec << queue_size_ << " (" - << std::hex << std::setw(4) << std::setfill('0') << its_client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << its_service << "." - << std::hex << std::setw(4) << std::setfill('0') << its_method << "." - << std::hex << std::setw(4) << std::setfill('0') << its_session << "]" + << " " << queue_.size() + << " " << queue_size_ << " (" + << std::hex << std::setfill('0') + << std::setw(4) << its_client << "): [" + << std::setw(4) << its_service << "." + << std::setw(4) << its_method << "." + << std::setw(4) << its_session << "]"; << " endpoint > " << this << " socket state > " << static_cast(state_.load()); print_status(); } @@ -801,12 +803,13 @@ bool client_endpoint_impl::check_queue_limit(const uint8_t *_data, std VSOMEIP_ERROR << "cei::check_queue_limit: queue size limit (" << std::dec << endpoint_impl::queue_limit_ << ") reached. Dropping message (" - << std::hex << std::setw(4) << std::setfill('0') << its_client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << its_service << "." - << std::hex << std::setw(4) << std::setfill('0') << its_method << "." - << std::hex << std::setw(4) << std::setfill('0') << its_session << "] " + << std::hex << std::setfill('0') + << std::setw(4) << its_client << "): [" + << std::setw(4) << its_service << "." + << std::setw(4) << its_method << "." + << std::setw(4) << its_session << "] " << "queue_size: " << std::dec << queue_size_ - << " data size: " << std::dec << _size; + << " data size: " << _size; return false; } return true; diff --git a/implementation/endpoints/src/server_endpoint_impl.cpp b/implementation/endpoints/src/server_endpoint_impl.cpp index 97f43d49b..6b5ae6ce6 100644 --- a/implementation/endpoints/src/server_endpoint_impl.cpp +++ b/implementation/endpoints/src/server_endpoint_impl.cpp @@ -715,10 +715,11 @@ void server_endpoint_impl::send_cbk(const endpoint_type _key, parse_message_ids(its_buffer, its_service, its_method, its_client, its_session); VSOMEIP_WARNING << __func__ << ": prevented queue_size underflow. queue_size: " << its_data.queue_size_ << " payload_size: " << payload_size << " payload: (" - << std::hex << std::setw(4) << std::setfill('0') << its_client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << its_service << "." - << std::hex << std::setw(4) << std::setfill('0') << its_method << "." - << std::hex << std::setw(4) << std::setfill('0') << its_session << "]"; + << std::hex << std::setfill('0') + << std::setw(4) << its_client <<"): [" + << std::setw(4) << its_service << "." + << std::setw(4) << its_method << "." + << std::setw(4) << its_session << "]"; its_data.queue_.pop_front(); recalculate_queue_size(its_data); } diff --git a/implementation/logger/src/message.cpp b/implementation/logger/src/message.cpp index 0ea45922f..70d9dfd96 100644 --- a/implementation/logger/src/message.cpp +++ b/implementation/logger/src/message.cpp @@ -125,15 +125,19 @@ message::~message() try { #ifndef ANDROID { std::unique_lock app_name_lock = its_logger->get_app_name_lock(); - std::cout << std::dec << std::setw(4) << its_time.tm_year + 1900 << "-" << std::dec - << std::setw(2) << std::setfill('0') << its_time.tm_mon + 1 << "-" - << std::dec << std::setw(2) << std::setfill('0') << its_time.tm_mday - << " " << std::dec << std::setw(2) << std::setfill('0') - << its_time.tm_hour << ":" << std::dec << std::setw(2) - << std::setfill('0') << its_time.tm_min << ":" << std::dec << std::setw(2) - << std::setfill('0') << its_time.tm_sec << "." << std::dec << std::setw(6) - << std::setfill('0') << its_ms << " " << its_logger->get_app_name() - << " [" << its_level << "] " << buffer_.data_.str() << std::endl; + std::cout + << std::dec + << std::setw(4) << its_time.tm_year + 1900 << "-" + << std::setfill('0') + << std::setw(2) << its_time.tm_mon + 1 << "-" + << std::setw(2) << its_time.tm_mday << " " + << std::setw(2) << its_time.tm_hour << ":" + << std::setw(2) << its_time.tm_min << ":" + << std::setw(2) << its_time.tm_sec << "." + << std::setw(6) << its_ms << " [" + << its_level << "] " + << buffer_.data_.str() + << std::endl; } #else std::string app = runtime::get_property("LogApplication"); diff --git a/implementation/routing/src/routing_manager_base.cpp b/implementation/routing/src/routing_manager_base.cpp index a9438ef4b..e4c0628ee 100644 --- a/implementation/routing/src/routing_manager_base.cpp +++ b/implementation/routing/src/routing_manager_base.cpp @@ -470,12 +470,10 @@ void routing_manager_base::register_event(client_t _client, VSOMEIP_WARNING << "Using debounce configuration for " << " SOME/IP event " - << std::hex << std::setw(4) << std::setfill('0') - << _service << "." - << std::hex << std::setw(4) << std::setfill('0') - << _instance << "." - << std::hex << std::setw(4) << std::setfill('0') - << _notifier << "." + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "." + << std::setw(4) << _notifier << "." << " Debounce parameters: " << its_debounce_parameters.str(); diff --git a/implementation/routing/src/routing_manager_client.cpp b/implementation/routing/src/routing_manager_client.cpp index e480be63a..6a1cb68ae 100644 --- a/implementation/routing/src/routing_manager_client.cpp +++ b/implementation/routing/src/routing_manager_client.cpp @@ -1079,11 +1079,13 @@ void routing_manager_client::on_message( if (configuration_->is_security_enabled() && configuration_->is_local_routing() && !is_from_routing && _bound_client != its_client) { - VSOMEIP_WARNING << "Client " << std::hex << std::setw(4) << std::setfill('0') - << get_client() << " received a message with command " << int(its_id) - << " from " << std::hex << std::setw(4) << std::setfill('0') - << its_client << " which doesn't match the bound client " << std::hex - << std::setw(4) << std::setfill('0') << _bound_client + VSOMEIP_WARNING << "Client " + << std::hex << std::setfill('0') + << std::setw(4) << get_client() + << " received a message with command " << int(its_id) + << " from " << std::setw(4) << its_client + << " which doesn't match the bound client " + << std::setw(4) << _bound_client << " ~> skip message!"; return; } @@ -1142,15 +1144,14 @@ void routing_manager_client::on_message( if (configuration_->is_security_enabled() && configuration_->is_local_routing() && its_message->get_client() != _bound_client) { - VSOMEIP_WARNING << std::hex << "vSomeIP Security: Client 0x" - << std::hex << std::setw(4) << std::setfill('0') << get_client() - << " received a request from client 0x" - << std::hex << std::setw(4) << std::setfill('0') << its_message->get_client() - << " to service/instance/method " << its_message->get_service() - << "/" << its_message->get_instance() << "/" << its_message->get_method() - << " which doesn't match the bound client 0x" - << std::hex << std::setw(4) << std::setfill('0') << _bound_client - << " ~> skip message!"; + VSOMEIP_WARNING << std::hex << std::setfill('0') + << "vSomeIP Security: Client 0x" << std::setw(4) << get_client() + << " received a request from client 0x" << std::setw(4) << its_message->get_client() + << " to service/instance/method " + << its_message->get_service() << "/" << its_message->get_instance() + << "/" << its_message->get_method() + << " which doesn't match the bound client 0x" << std::setw(4) << _bound_client + << " ~> skip message!"; return; } if (VSOMEIP_SEC_OK != configuration_->get_security()->is_client_allowed_to_access_member( @@ -1353,20 +1354,18 @@ void routing_manager_client::on_message( its_eventgroup, its_event, its_pending_id); } - VSOMEIP_INFO - << "SUBSCRIBE(" << std::hex << std::setw(4) - << std::setfill('0') << its_client << "): [" << std::hex - << std::setw(4) << std::setfill('0') << its_service - << "." << std::hex << std::setw(4) << std::setfill('0') - << its_instance << "." << std::hex << std::setw(4) - << std::setfill('0') << its_eventgroup << ":" - << std::hex << std::setw(4) << std::setfill('0') - << its_event << ":" << std::dec << (uint16_t)its_major - << "] " << std::boolalpha - << (its_pending_id != PENDING_SUBSCRIPTION_ID) << " " - << (_subscription_accepted - ? std::to_string(its_count) + " accepted." - : "not accepted."); + VSOMEIP_INFO << "SUBSCRIBE(" + << std::hex << std::setfill('0') + << std::setw(4) << its_client << "): [" + << std::setw(4) << its_service << "." + << std::setw(4) << its_instance << "." + << std::setw(4) << its_eventgroup << ":" + << std::setw(4) << its_event << ":" + << std::dec << (uint16_t)its_major << "] " + << std::boolalpha << (its_pending_id != PENDING_SUBSCRIPTION_ID) + << " " + << (_subscription_accepted ? + std::to_string(its_count) + " accepted." : "not accepted."); }); } else { send_subscribe_nack(its_client, its_service, its_instance, its_eventgroup, @@ -2113,7 +2112,7 @@ void routing_manager_client::reconnect(const std::map &_c } } - VSOMEIP_INFO << std::hex << "Application/Client " + VSOMEIP_INFO << "Application/Client " << std::hex << std::setw(4) << std::setfill('0') << get_client() <<": Reconnecting to routing manager."; @@ -2424,12 +2423,13 @@ void routing_manager_client::on_subscribe_ack(client_t _client, (void)_client; #if 0 VSOMEIP_ERROR << "routing_manager_client::" << __func__ - << "(" << std::hex << std::setw(4) << std::setfill('0') << host_->get_client() << "):" + << std::hex << std::setfill('0') + << "(" << std::setw(4) << host_->get_client() << "):" << "event=" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance << "." - << std::hex << std::setw(4) << std::setfill('0') << _eventgroup << "." - << std::hex << std::setw(4) << std::setfill('0') << _event; + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "." + << std::setw(4) << _eventgroup << "." + << std::setw(4) << _event; #endif if (_event == ANY_EVENT) { auto its_eventgroup = find_eventgroup(_service, _instance, _eventgroup); diff --git a/implementation/routing/src/routing_manager_impl.cpp b/implementation/routing/src/routing_manager_impl.cpp index 9d45c656a..15ba8e9e0 100644 --- a/implementation/routing/src/routing_manager_impl.cpp +++ b/implementation/routing/src/routing_manager_impl.cpp @@ -409,11 +409,11 @@ bool routing_manager_impl::offer_service(client_t _client, if (!insert_offer_command(_service, _instance, uint8_t(protocol::id_e::OFFER_SERVICE_ID), _client, _major, _minor)) { - VSOMEIP_INFO << "rmi::" << __func__ << " (" - << std::hex << std::setw(4) << std::setfill('0') << _client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance - << ":" << std::dec << int(_major) << "." << std::dec << _minor << "]" + VSOMEIP_INFO << "rmi::" << __func__ << std::setfill('0') << std::hex << " (" + << std::setw(4) << _client <<"): [" + << std::setw(4) << _service << "." + << std::setw(4) << _instance + << ":" << std::dec << int(_major) << "." << _minor << "]" << " (" << std::boolalpha << _must_queue << ")" << " not offering service, because insert_offer_command returned false!"; return false; @@ -437,12 +437,12 @@ bool routing_manager_impl::offer_service(client_t _client, if (!handle_local_offer_service(_client, _service, _instance, _major, _minor)) { erase_offer_command(_service, _instance); - VSOMEIP_INFO << __func__ << " (" - << std::hex << std::setw(4) << std::setfill('0') << _client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance - << ":" << std::dec << int(_major) << "." << std::dec << _minor << "]" - << " (" << std::boolalpha << _must_queue << ")" + VSOMEIP_INFO << "rmi::" << __func__ << std::setfill('0') << std::hex << " (" + << std::setw(4) << _client <<"): [" + << std::setw(4) << _service << "." + << std::setw(4) << _instance + << ":" << std::dec << int(_major) << "." << _minor << "]" + << " (" << std::boolalpha << _must_queue << ")" << " not offering, returned from handle_local_offer_service!"; return false; } @@ -491,12 +491,12 @@ bool routing_manager_impl::offer_service(client_t _client, erase_offer_command(_service, _instance); VSOMEIP_INFO << "OFFER(" - << std::hex << std::setw(4) << std::setfill('0') << _client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance - << ":" << std::dec << int(_major) << "." << std::dec << _minor << "]" - << " (" << std::boolalpha << _must_queue << ")"; - + << std::hex << std::setfill('0') + << std::setw(4) << _client << "): [" + << std::setw(4) << _service << "." + << std::setw(4) << _instance + << ":" << std::dec << int(_major) << "." << _minor << "]" + << " (" << std::boolalpha << _must_queue << ")"; return true; } @@ -525,9 +525,10 @@ void routing_manager_impl::stop_offer_service(client_t _client, uint8_t(protocol::id_e::STOP_OFFER_SERVICE_ID), _client, _major, _minor)) { VSOMEIP_INFO << "rmi::" << __func__ << " (" - << std::hex << std::setw(4) << std::setfill('0') << _client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance + << std::hex << std::setfill('0') + << std::setw(4) << _client <<"): [" + << std::setw(4) << _service << "." + << std::setw(4) << _instance << ":" << std::dec << int(_major) << "." << _minor << "]" << " (" << std::boolalpha << _must_queue << ")" << " STOP-OFFER NOT INSERTED!"; @@ -1464,9 +1465,10 @@ bool routing_manager_impl::stop_offer_service_remotely(service_t _service, // still offered its_copied_info->set_endpoint(std::shared_ptr(), !_reliable); discovery_->stop_offer_service(its_copied_info, true); - VSOMEIP_INFO << __func__ << " only sending the StopOffer to [" - << std::hex << std::setw(4) << std::setfill('0') << _service << '.' - << std::hex << std::setw(4) << std::setfill('0') << _instance << ']' + VSOMEIP_INFO << __func__ << std::hex << std::setfill('0') + << " only sending the StopOffer to [" + << std::setw(4) << _service << '.' + << std::setw(4) << _instance << ']' << " with reliability (" << std::boolalpha << !_reliable << ')' << " as the service is still partly offered!"; } @@ -2109,9 +2111,10 @@ bool routing_manager_impl::deliver_notification( if (has_subscribed_eventgroup(_service, _instance)) { if (!is_suppress_event(_service, _instance, its_event_id)) { VSOMEIP_WARNING << __func__ << ": Caching unregistered event [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance << "." - << std::hex << std::setw(4) << std::setfill('0') << its_event_id << "]"; + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "." + << std::setw(4) << its_event_id << "]"; } routing_manager_base::register_event(host_->get_client(), @@ -2130,22 +2133,25 @@ bool routing_manager_impl::deliver_notification( its_event->set_payload(its_payload, true); } else VSOMEIP_ERROR << __func__ << ": Event registration failed [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance << "." - << std::hex << std::setw(4) << std::setfill('0') << its_event_id << "]"; + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "." + << std::setw(4) << its_event_id << "]"; } else if (!is_suppress_event(_service, _instance, its_event_id)) { VSOMEIP_WARNING << __func__ << ": Dropping unregistered event [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance << "." - << std::hex << std::setw(4) << std::setfill('0') << its_event_id << "] " + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "." + << std::setw(4) << its_event_id << "] " << "Service has no subscribed eventgroup."; } #else if (!is_suppress_event(_service, _instance, its_event_id)) { VSOMEIP_WARNING << __func__ << ": Event [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance << "." - << std::hex << std::setw(4) << std::setfill('0') << its_event_id << "]" + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "." + << std::setw(4) << its_event_id << "]" << " is not registered. The message is dropped."; } #endif // VSOMEIP_ENABLE_DEFAULT_EVENT_CACHING @@ -2804,9 +2810,10 @@ routing_manager_impl::expire_subscriptions( : its_info->get_remote_subscriptions()) { if (its_subscription->is_forwarded()) { VSOMEIP_WARNING << __func__ << ": New remote subscription replaced expired [" - << std::hex << std::setw(4) << std::setfill('0') << its_service.first << "." - << std::hex << std::setw(4) << std::setfill('0') << its_instance.first << "." - << std::hex << std::setw(4) << std::setfill('0') << its_eventgroup.first << "]"; + << std::hex << std::setfill('0') + << std::setw(4) << its_service.first << "." + << std::setw(4) << its_instance.first << "." + << std::setw(4) << its_eventgroup.first << "]"; continue; } @@ -3350,9 +3357,10 @@ routing_manager_impl::expire_subscriptions(bool _force) { continue; } else if (s->is_forwarded()) { VSOMEIP_WARNING << __func__ << ": New remote subscription replaced expired [" - << std::hex << std::setw(4) << std::setfill('0') << its_service.first << "." - << std::hex << std::setw(4) << std::setfill('0') << its_instance.first << "." - << std::hex << std::setw(4) << std::setfill('0') << its_eventgroup.first << "]"; + << std::hex << std::setfill('0') + << std::setw(4) << its_service.first << "." + << std::setw(4) << its_instance.first << "." + << std::setw(4) << its_eventgroup.first << "]"; continue; } for (auto its_client : s->get_clients()) { @@ -3590,9 +3598,10 @@ bool routing_manager_impl::handle_local_offer_service(client_t _client, service_ } } else { VSOMEIP_INFO << __func__ - << std::hex << std::setw(4) << std::setfill('0') << _client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << _service << "." - << std::hex << std::setw(4) << std::setfill('0') << _instance + << std::hex << std::setfill('0') + << std::setw(4) << _client <<"): [" + << std::setw(4) << _service << "." + << std::setw(4) << _instance << ":" << std::dec << int(_major) << "." << std::dec << _minor << "]" << " client already pinged!"; return false; @@ -3804,8 +3813,9 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) { // Inconsistency between services_ and local_services_ table detected // --> cleanup. VSOMEIP_WARNING << "rmi::" << __func__ << " Found table inconsistency for [" - << std::hex << std::setw(4) << std::setfill('0') << its_service.first << "." - << std::hex << std::setw(4) << std::setfill('0') << its_instance.first << "]"; + << std::hex << std::setfill('0') + << std::setw(4) << its_service.first << "." + << std::setw(4) << its_instance.first << "]"; // Remove the service from the offer_commands_ and prepare_stop_handlers_ to force the next offer to be processed offer_commands_.erase(std::make_pair(its_service.first, its_instance.first)); diff --git a/implementation/runtime/src/application_impl.cpp b/implementation/runtime/src/application_impl.cpp index e632770ab..5b4b8e9eb 100644 --- a/implementation/runtime/src/application_impl.cpp +++ b/implementation/runtime/src/application_impl.cpp @@ -237,7 +237,8 @@ bool application_impl::init() { } else { VSOMEIP_INFO << "+filter " << std::hex << std::setfill('0') - << std::setw(4) << prev_val << "." << std::setw(4) << val; + << std::setw(4) << prev_val << "." + << std::setw(4) << val; client_side_logging_filter_.insert(std::make_tuple(prev_val, val)); } val = 0xffffu; diff --git a/implementation/service_discovery/src/service_discovery_impl.cpp b/implementation/service_discovery/src/service_discovery_impl.cpp index 768384b21..91f6dfe5e 100644 --- a/implementation/service_discovery/src/service_discovery_impl.cpp +++ b/implementation/service_discovery/src/service_discovery_impl.cpp @@ -1558,10 +1558,10 @@ void service_discovery_impl::process_offerservice_serviceentry( if (update_remote_offer_type(_service, _instance, offer_type, _reliable_address, _reliable_port, _unreliable_address, _unreliable_port, _received_via_multicast)) { - VSOMEIP_WARNING << __func__ << ": Remote offer type changed [" << std::hex << std::setw(4) - << std::setfill('0') << _service << "." << std::hex << std::setw(4) - << std::setfill('0') << _instance << "]"; - + VSOMEIP_WARNING << __func__ << ": Remote offer type changed [" + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "]"; // Only update eventgroup reliability type if it was initially unknown auto its_eventgroups = host_->get_subscribed_eventgroups(_service, _instance); for (auto eg : its_eventgroups) { @@ -3651,9 +3651,11 @@ bool service_discovery_impl::update_remote_offer_type( break; case reliability_type_e::RT_UNKNOWN: default: - VSOMEIP_WARNING << __func__ << ": unknown offer type [" << std::hex << std::setw(4) - << std::setfill('0') << _service << "." << std::hex << std::setw(4) - << std::setfill('0') << _instance << "]" << static_cast(_offer_type); + VSOMEIP_WARNING << __func__ << ": unknown offer type [" + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "]" + << static_cast(_offer_type); break; } return ret; @@ -3770,9 +3772,11 @@ bool service_discovery_impl::set_offer_multicast_state( break; case reliability_type_e::RT_UNKNOWN: default: - VSOMEIP_WARNING << __func__ << ": unknown offer type [" << std::hex << std::setw(4) - << std::setfill('0') << _service << "." << std::hex << std::setw(4) - << std::setfill('0') << _instance << "]" << static_cast(_offer_type); + VSOMEIP_WARNING << __func__ << ": unknown offer type [" + << std::hex << std::setfill('0') + << std::setw(4) << _service << "." + << std::setw(4) << _instance << "]" + << static_cast(_offer_type); break; } diff --git a/test/network_tests/application_tests/application_test_client.cpp b/test/network_tests/application_tests/application_test_client.cpp index ba05511a4..595f1f939 100644 --- a/test/network_tests/application_tests/application_test_client.cpp +++ b/test/network_tests/application_tests/application_test_client.cpp @@ -105,9 +105,10 @@ class application_test_client : public vsomeip_utilities::base_logger { EXPECT_EQ(service_info_.service_id, _message->get_service()); EXPECT_EQ(service_info_.method_id, _message->get_method()); EXPECT_EQ(service_info_.instance_id, _message->get_instance()); - VSOMEIP_INFO << "[Client] Received a response with Client/Session [" << std::setfill('0') - << std::hex << std::setw(4) << _message->get_client() << "/" << std::setw(4) - << _message->get_session() << "]"; + VSOMEIP_INFO << "Received a response with Client/Session [" + << std::setfill('0') << std::hex + << std::setw(4) << _message->get_client() << "/" + << std::setw(4) << _message->get_session() << "]"; } void send() { From 9228c399ebc7786e35fa6558c282b8a607baf6c3 Mon Sep 17 00:00:00 2001 From: Duarte Fonseca Date: Mon, 7 Oct 2024 12:30:10 +0100 Subject: [PATCH 2/6] Fixing misplaced semicolon --- implementation/endpoints/src/client_endpoint_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation/endpoints/src/client_endpoint_impl.cpp b/implementation/endpoints/src/client_endpoint_impl.cpp index 1b8ed60de..a0d07e585 100644 --- a/implementation/endpoints/src/client_endpoint_impl.cpp +++ b/implementation/endpoints/src/client_endpoint_impl.cpp @@ -569,7 +569,7 @@ void client_endpoint_impl::send_cbk( << std::setw(4) << its_client << "): [" << std::setw(4) << its_service << "." << std::setw(4) << its_method << "." - << std::setw(4) << its_session << "]"; + << std::setw(4) << its_session << "]" << " endpoint > " << this << " socket state > " << static_cast(state_.load()); } } @@ -629,7 +629,7 @@ void client_endpoint_impl::send_cbk( << std::setw(4) << its_client << "): [" << std::setw(4) << its_service << "." << std::setw(4) << its_method << "." - << std::setw(4) << its_session << "]"; + << std::setw(4) << its_session << "]" << " endpoint > " << this << " socket state > " << static_cast(state_.load()); print_status(); } From 87136bf47283a188b297816fdbab7a1d16b46fdd Mon Sep 17 00:00:00 2001 From: Duarte Fonseca Date: Tue, 8 Oct 2024 16:33:40 +0100 Subject: [PATCH 3/6] Adding last changes for sync --- .../endpoints/src/server_endpoint_impl.cpp | 1 - .../src/tcp_client_endpoint_impl.cpp | 9 ++++---- implementation/logger/src/message.cpp | 22 +++++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/implementation/endpoints/src/server_endpoint_impl.cpp b/implementation/endpoints/src/server_endpoint_impl.cpp index 6b5ae6ce6..c33596d0a 100644 --- a/implementation/endpoints/src/server_endpoint_impl.cpp +++ b/implementation/endpoints/src/server_endpoint_impl.cpp @@ -749,7 +749,6 @@ void server_endpoint_impl::send_cbk(const endpoint_type _key, VSOMEIP_WARNING << "sei::send_cbk received error: " << _error.message() << " (" << std::dec << _error.value() << ") " << get_remote_information(it) << " " - << std::dec << its_data.queue_.size() << " " << its_data.queue_size_ << " (" << std::hex << std::setfill('0') << std::setw(4) << its_client << "): [" diff --git a/implementation/endpoints/src/tcp_client_endpoint_impl.cpp b/implementation/endpoints/src/tcp_client_endpoint_impl.cpp index 124c78b70..6a0192fbf 100644 --- a/implementation/endpoints/src/tcp_client_endpoint_impl.cpp +++ b/implementation/endpoints/src/tcp_client_endpoint_impl.cpp @@ -993,10 +993,11 @@ void tcp_client_endpoint_impl::send_cbk(boost::system::error_code const &_error, << _error.value() << ") " << get_remote_information() << " " << std::dec << queue_.size() << " " << std::dec << queue_size_ << " (" - << std::hex << std::setw(4) << std::setfill('0') << its_client <<"): [" - << std::hex << std::setw(4) << std::setfill('0') << its_service << "." - << std::hex << std::setw(4) << std::setfill('0') << its_method << "." - << std::hex << std::setw(4) << std::setfill('0') << its_session << "]"; + << std::hex << std::setfill('0') + << std::setw(4) << its_client << "): [" + << std::setw(4) << its_service << "." + << std::setw(4) << its_method << "." + << std::setw(4) << its_session << "]"; } } } diff --git a/implementation/logger/src/message.cpp b/implementation/logger/src/message.cpp index 70d9dfd96..f56c7c59a 100644 --- a/implementation/logger/src/message.cpp +++ b/implementation/logger/src/message.cpp @@ -170,15 +170,19 @@ message::~message() try { if (its_logger->has_file_log()) { std::ofstream its_logfile(its_logger->get_logfile(), std::ios_base::app); if (its_logfile.is_open()) { - its_logfile << std::dec << std::setw(4) << its_time.tm_year + 1900 << "-" - << std::dec << std::setw(2) << std::setfill('0') << its_time.tm_mon + 1 - << "-" << std::dec << std::setw(2) << std::setfill('0') - << its_time.tm_mday << " " << std::dec << std::setw(2) - << std::setfill('0') << its_time.tm_hour << ":" << std::dec - << std::setw(2) << std::setfill('0') << its_time.tm_min << ":" - << std::dec << std::setw(2) << std::setfill('0') << its_time.tm_sec - << "." << std::dec << std::setw(6) << std::setfill('0') << its_ms - << " [" << its_level << "] " << buffer_.data_.str() << std::endl; + its_logfile + << std::dec + << std::setw(4) << its_time.tm_year + 1900 << "-" + << std::setfill('0') + << std::setw(2) << its_time.tm_mon + 1 << "-" + << std::setw(2) << its_time.tm_mday << " " + << std::setw(2) << its_time.tm_hour << ":" + << std::setw(2) << its_time.tm_min << ":" + << std::setw(2) << its_time.tm_sec << "." + << std::setw(6) << its_ms << " [" + << its_level << "] " + << buffer_.data_.str() + << std::endl; } } } From bd767fc4d3eee2108e0163bac2890e2ce3170566 Mon Sep 17 00:00:00 2001 From: Duarte Fonseca Date: Tue, 8 Oct 2024 17:15:01 +0100 Subject: [PATCH 4/6] remove unneeded std::dec --- implementation/configuration/src/configuration_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation/configuration/src/configuration_impl.cpp b/implementation/configuration/src/configuration_impl.cpp index 4e8215100..7b7d048f3 100644 --- a/implementation/configuration/src/configuration_impl.cpp +++ b/implementation/configuration/src/configuration_impl.cpp @@ -4490,7 +4490,7 @@ void configuration_impl::load_someip_tp_for_service( << std::setw(4) << its_method << "]:" << " using (" << std::dec << its_entry->second.first << ", " - << std::dec << its_entry->second.second << ")"; + << its_entry->second.second << ")"; } } } else { From a7a657e0e6c21bdd51a4966be4a363b716bdb7b3 Mon Sep 17 00:00:00 2001 From: Duarte Fonseca Date: Tue, 8 Oct 2024 17:27:06 +0100 Subject: [PATCH 5/6] revert removing of log --- implementation/endpoints/src/server_endpoint_impl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation/endpoints/src/server_endpoint_impl.cpp b/implementation/endpoints/src/server_endpoint_impl.cpp index c33596d0a..29e916ba3 100644 --- a/implementation/endpoints/src/server_endpoint_impl.cpp +++ b/implementation/endpoints/src/server_endpoint_impl.cpp @@ -749,6 +749,7 @@ void server_endpoint_impl::send_cbk(const endpoint_type _key, VSOMEIP_WARNING << "sei::send_cbk received error: " << _error.message() << " (" << std::dec << _error.value() << ") " << get_remote_information(it) << " " + << its_data.queue_.size() << " " << its_data.queue_size_ << " (" << std::hex << std::setfill('0') << std::setw(4) << its_client << "): [" From a091fd44d8d6ba8df542455fbe654891b3a3efa7 Mon Sep 17 00:00:00 2001 From: Duarte Fonseca Date: Wed, 9 Oct 2024 12:36:08 +0100 Subject: [PATCH 6/6] Add missing logger line --- implementation/logger/src/message.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/implementation/logger/src/message.cpp b/implementation/logger/src/message.cpp index f56c7c59a..67fc12943 100644 --- a/implementation/logger/src/message.cpp +++ b/implementation/logger/src/message.cpp @@ -179,7 +179,8 @@ message::~message() try { << std::setw(2) << its_time.tm_hour << ":" << std::setw(2) << its_time.tm_min << ":" << std::setw(2) << its_time.tm_sec << "." - << std::setw(6) << its_ms << " [" + << std::setw(6) << its_ms << " " + << its_logger->get_app_name() << " [" << its_level << "] " << buffer_.data_.str() << std::endl;