Skip to content

Commit

Permalink
print router id on startup (#189)
Browse files Browse the repository at this point in the history
* print router id on startup

* Update rmw_zenoh_cpp/src/zenohd/main.cpp

Signed-off-by: Yadu <[email protected]>

* Nit

Signed-off-by: Yadunund <[email protected]>

---------

Signed-off-by: Yadu <[email protected]>
Signed-off-by: Yadunund <[email protected]>
Co-authored-by: Yadu <[email protected]>
Co-authored-by: Yadunund <[email protected]>
  • Loading branch information
3 people authored Jun 6, 2024
1 parent dc1b047 commit 1caf7f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions rmw_zenoh_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ install(
add_executable(rmw_zenohd
src/zenohd/main.cpp
src/detail/zenoh_config.cpp
src/detail/liveliness_utils.cpp
)

target_link_libraries(rmw_zenohd
PRIVATE
ament_index_cpp::ament_index_cpp
rcutils::rcutils
rcpputils::rcpputils
rmw::rmw
zenohc::lib
)
Expand Down
5 changes: 4 additions & 1 deletion rmw_zenoh_cpp/src/zenohd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <ament_index_cpp/get_package_share_directory.hpp>

#include "../detail/zenoh_config.hpp"
#include "../detail/liveliness_utils.hpp"

#include "rmw/error_handling.h"

Expand Down Expand Up @@ -188,7 +189,9 @@ int main(int argc, char ** argv)
printf("Unable to open router session!\n");
return 1;
}

printf(
"Started Zenoh router with id %s.\n",
rmw_zenoh_cpp::liveliness::zid_to_str(z_info_zid(z_session_loan(&s))).c_str());
#ifdef _WIN32
SetConsoleCtrlHandler(quit, TRUE);
#else
Expand Down

0 comments on commit 1caf7f1

Please sign in to comment.