diff --git a/ecal/core/src/registration/ecal_process_registration.cpp b/ecal/core/src/registration/ecal_process_registration.cpp index 34b6104a89..465193dd34 100644 --- a/ecal/core/src/registration/ecal_process_registration.cpp +++ b/ecal/core/src/registration/ecal_process_registration.cpp @@ -38,6 +38,9 @@ eCAL::Registration::Sample eCAL::Registration::GetProcessRegisterSample() auto& process_sample_identifier = process_sample.identifier; process_sample_identifier.host_name = eCAL::Process::GetHostName(); process_sample_identifier.process_id = eCAL::Process::GetProcessID(); + // We need to set the pid as entity_id. + // However, we cannot send anything over the wire :( + process_sample_identifier.entity_id = std::to_string(process_sample_identifier.process_id); auto& process_sample_process = process_sample.process; process_sample_process.hgname = eCAL::Process::GetHostGroupName(); diff --git a/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp b/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp index 761e103bfc..1e0fb62a7f 100644 --- a/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp +++ b/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp @@ -407,6 +407,8 @@ namespace registration_.process.rclock = pb_sample_.process.rclock; // pid registration_.identifier.process_id = pb_sample_.process.pid; + // tid -> we need to use the PID here, because we don't have a designated field for it + registration_.identifier.entity_id = std::to_string(registration_.identifier.process_id); // state.severity registration_.process.state.severity = static_cast(pb_sample_.process.state.severity); // state.severity_level diff --git a/ecal/tests/cpp/serialization_test/src/registration_generate.cpp b/ecal/tests/cpp/serialization_test/src/registration_generate.cpp index 1fd33ece09..79a90c545e 100644 --- a/ecal/tests/cpp/serialization_test/src/registration_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/registration_generate.cpp @@ -152,7 +152,7 @@ namespace eCAL sample.host.hname = GenerateString(8); sample.identifier = GenerateIdentifier(); // Process samples don't have an id internally, hence it must be 0. - sample.identifier.entity_id = ""; + sample.identifier.entity_id = std::to_string(sample.identifier.process_id); sample.process = GenerateProcess(); return sample; }