Skip to content

Commit

Permalink
add pyrealdds.adapter_list()
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Sep 10, 2024
1 parent 4aef014 commit 579f9b8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions third-party/realdds/py/pyrealdds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <realdds/dds-metadata-syncer.h>
#include <realdds/dds-serialization.h>
#include <realdds/dds-sample.h>
#include <realdds/dds-adapter-watcher.h>

#include <rsutils/os/special-folder.h>
#include <rsutils/os/executable-name.h>
Expand Down Expand Up @@ -120,6 +121,17 @@ json load_rs_settings( json const & local_settings )
}


py::list adapter_list()
{
auto const ips = realdds::dds_adapter_watcher::current_ips();
py::list obj( ips.size() );
int i = 0;
for( auto & ip : ips )
obj[i++] = ip;
return std::move( obj );
}


} // namespace


Expand Down Expand Up @@ -225,6 +237,9 @@ PYBIND11_MODULE(NAME, m) {
m.def( "timestr", []( dds_time t ) { return timestr( t ).to_string(); } );


m.def( "adapter_list", &adapter_list );


py::class_< dds_participant::listener,
std::shared_ptr< dds_participant::listener > // handled with a shared_ptr
>
Expand Down

0 comments on commit 579f9b8

Please sign in to comment.