Skip to content

Commit

Permalink
add device-connected or -disconnected debug msgs to DDS
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Sep 30, 2024
1 parent a188c13 commit 7ed6511
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend-device-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ backend_device_factory::backend_device_factory( std::shared_ptr< context > const
for( auto & device_removed : subtract_sets( old_list, new_list ) )
{
devices_removed.push_back( device_removed );
LOG_DEBUG( "Device disconnected: " << device_removed->get_address() );
LOG_INFO( "Device disconnected: " << device_removed->get_address() );
}

std::vector< std::shared_ptr< device_info > > devices_added;
for( auto & device_added : subtract_sets( new_list, old_list ) )
{
devices_added.push_back( device_added );
LOG_DEBUG( "Device connected: " << device_added->get_address() );
LOG_INFO( "Device connected: " << device_added->get_address() );
}

if( devices_removed.size() + devices_added.size() )
Expand Down
6 changes: 6 additions & 0 deletions src/dds/rsdds-device-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,15 @@ rsdds_device_factory::rsdds_device_factory( std::shared_ptr< context > const & c
std::vector< std::shared_ptr< device_info > > infos_removed;
auto dev_info = std::make_shared< dds_device_info >( ctx, dev );
if( added )
{
infos_added.push_back( dev_info );
LOG_INFO( "Device connected: " << dev_info->get_address() );
}
else
{
infos_removed.push_back( dev_info );
LOG_INFO( "Device disconnected: " << dev_info->get_address() );
}
cb( infos_removed, infos_added );
} );
}
Expand Down

0 comments on commit 7ed6511

Please sign in to comment.