MCPcopy Create free account
hub / github.com/COVESA/vsomeip / init_service_info

Method init_service_info

implementation/routing/src/routing_manager_impl.cpp:1551–1588  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// PRIVATE //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1549// PRIVATE
1550///////////////////////////////////////////////////////////////////////////////
1551void routing_manager_impl::init_service_info(service_t _service, instance_t _instance, bool _is_local_service) {
1552 std::shared_ptr<serviceinfo> its_info = find_service(_service, _instance);
1553 if (!its_info) {
1554 VSOMEIP_ERROR_P << "Couldn't find serviceinfo for service: [" << hex4(_service) << "." << hex4(_instance)
1555 << "] is_local_service=" << _is_local_service;
1556 return;
1557 }
1558 if (configuration_) {
1559 // Create server endpoints for local services only
1560 if (_is_local_service) {
1561 const bool is_someip = configuration_->is_someip(_service, _instance);
1562 uint16_t its_reliable_port = configuration_->get_reliable_port(_service, _instance);
1563 bool _is_found(false);
1564 if (ILLEGAL_PORT != its_reliable_port) {
1565 auto its_reliable_endpoint =
1566 ep_mgr_impl_->find_or_create_server_endpoint(its_reliable_port, true, is_someip, _service, _instance, _is_found);
1567 if (its_reliable_endpoint) {
1568 its_info->set_endpoint(its_reliable_endpoint, true);
1569 }
1570 }
1571 uint16_t its_unreliable_port = configuration_->get_unreliable_port(_service, _instance);
1572 if (ILLEGAL_PORT != its_unreliable_port) {
1573 auto its_unreliable_endpoint =
1574 ep_mgr_impl_->find_or_create_server_endpoint(its_unreliable_port, false, is_someip, _service, _instance, _is_found);
1575 if (its_unreliable_endpoint) {
1576 its_info->set_endpoint(its_unreliable_endpoint, false);
1577 }
1578 }
1579
1580 if (ILLEGAL_PORT == its_reliable_port && ILLEGAL_PORT == its_unreliable_port) {
1581 VSOMEIP_INFO << "Port configuration missing for [" << hex4(_service) << "." << hex4(_instance) << "]. Service is internal.";
1582 }
1583 its_info->set_is_in_preparation(false);
1584 }
1585 } else {
1586 VSOMEIP_ERROR << "Missing vsomeip configuration.";
1587 }
1588}
1589
1590void routing_manager_impl::remove_local(client_t _client) {
1591

Callers

nothing calls this directly

Calls 7

hex4Function · 0.85
is_someipMethod · 0.80
get_reliable_portMethod · 0.80
get_unreliable_portMethod · 0.80
set_is_in_preparationMethod · 0.80
set_endpointMethod · 0.45

Tested by

no test coverage detected