Skip to content

Commit

Permalink
update print usage
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Dec 3, 2023
1 parent a84a7e1 commit e408acc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions third-party/realdds/src/dds-device-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ void dds_device::impl::handle_notification( nlohmann::json const & j,
if( sample.size() == 2 && sample.is_array() )
{
// We have to be the ones who sent the control!
auto const guid_string = rsutils::json::get< std::string >( sample, 0 );
auto const control_guid_string = realdds::print( _control_writer->get()->guid(), false ); // raw guid
if( guid_string == control_guid_string )
auto const reply_guid = guid_from_string( rsutils::json::get< std::string >( sample, 0 ) );
auto const control_guid = _control_writer->get()->guid();
if( reply_guid == control_guid )
{
auto const sequence_number = rsutils::json::get< uint64_t >( sample, 1 );
std::unique_lock< std::mutex > lock( _replies_mutex );
Expand Down
2 changes: 1 addition & 1 deletion third-party/realdds/src/dds-device-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void dds_device_server::on_control_message_received()
{
json reply;
reply[sample_key] = json::array( {
realdds::print( sample.sample_identity.writer_guid(), false ), // raw guid
rsutils::string::from( realdds::print_raw_guid( sample.sample_identity.writer_guid() ) ),
sample.sample_identity.sequence_number().to64long(),
} );
try
Expand Down
2 changes: 1 addition & 1 deletion third-party/realdds/src/dds-device-watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void dds_device_watcher::start()
init();
}
LOG_DEBUG( "DDS device watcher started on '" << _participant->get()->get_qos().name() << "' "
<< realdds::print( _participant->guid() ) );
<< realdds::print_guid( _participant->guid() ) );
}

void dds_device_watcher::stop()
Expand Down
6 changes: 3 additions & 3 deletions third-party/realdds/src/dds-participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct dds_participant::listener_impl : public eprosima::fastdds::dds::DomainPar
{
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT: {
std::string name;
std::string guid = realdds::print( info.info.m_guid ); // has to be outside the mutex
std::string guid = rsutils::string::from( realdds::print_guid( info.info.m_guid ) ); // has to be outside the mutex
{
std::lock_guard< std::mutex > lock( participants_mutex );
participant_info pinfo( info.info.m_participantName, info.info.m_guid.guidPrefix );
Expand Down Expand Up @@ -243,7 +243,7 @@ void dds_participant::init( dds_domain_id domain_id, std::string const & partici
DDS_THROW( runtime_error, "provided settings are invalid" );
_settings = settings;

LOG_DEBUG( "participant '" << participant_name << "' (" << realdds::print( guid() ) << ") is up on domain "
LOG_DEBUG( "participant '" << participant_name << "' (" << realdds::print_guid( guid() ) << ") is up on domain "
<< domain_id << " with settings: " << _settings.dump( 4 ) );
#ifdef BUILD_EASYLOGGINGPP
// DDS participant destruction happens when all contexts are done with it but, in some situations (e.g., Python), it
Expand Down Expand Up @@ -291,7 +291,7 @@ rsutils::string::slice dds_participant::name() const

std::string dds_participant::print( dds_guid const & guid_to_print ) const
{
return realdds::print( guid_to_print, guid() );
return rsutils::string::from( realdds::print_guid( guid_to_print, guid() ) );
}


Expand Down

0 comments on commit e408acc

Please sign in to comment.