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

Method request_service

implementation/routing/src/routing_manager_impl.cpp:427–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void routing_manager_impl::request_service(client_t _client, service_t _service, instance_t _instance, major_version_t _major,
428 minor_version_t _minor) {
429
430 VSOMEIP_INFO << "REQUEST(" << hex4(_client) << "): [" << hex4(_service) << "." << hex4(_instance) << ":" << int(_major) << "." << _minor
431 << "]";
432
433 routing_manager_base::request_service(_client, _service, _instance, _major, _minor);
434
435 auto its_info = find_service(_service, _instance);
436 if (!its_info) {
437 add_requested_service(_client, _service, _instance, _major, _minor);
438 if (discovery_) {
439 if (!configuration_->is_local_service(_service, _instance)) {
440 // Non local service instance ~> tell SD to find it!
441 discovery_->request_service(_service, _instance, _major, _minor, DEFAULT_TTL);
442 } else {
443 VSOMEIP_INFO << "Avoid trigger SD find-service message for local service/instance/major/minor: " << hex4(_service) << "/"
444 << hex4(_instance) << "/" << static_cast<int>(_major) << "/" << _minor;
445 }
446 }
447 } else {
448 if (_major == its_info->get_major() || DEFAULT_MAJOR == its_info->get_major() || ANY_MAJOR == _major) {
449 if (!its_info->is_local()) {
450 add_requested_service(_client, _service, _instance, _major, _minor);
451 if (discovery_) {
452 // Non local service instance ~> tell SD to find it!
453 discovery_->request_service(_service, _instance, _major, _minor, DEFAULT_TTL);
454 }
455 its_info->add_client(_client);
456 ep_mgr_impl_->find_or_create_remote_client(_service, _instance);
457 }
458 }
459 }
460}
461
462void routing_manager_impl::release_service(client_t _client, service_t _service, instance_t _instance) {
463

Callers

nothing calls this directly

Calls 6

hex4Function · 0.85
is_local_serviceMethod · 0.80
get_majorMethod · 0.45
is_localMethod · 0.45
add_clientMethod · 0.45

Tested by

no test coverage detected