Use network_interface parameter in v2x_app

This commit is contained in:
Yu Asabe 2021-12-08 20:32:54 +09:00
parent cc7df79e28
commit b8b38afdae
1 changed files with 5 additions and 2 deletions

View File

@ -106,8 +106,11 @@ namespace v2x
boost::asio::io_service io_service; boost::asio::io_service io_service;
TimeTrigger trigger(io_service); TimeTrigger trigger(io_service);
const char* device_name = "vmnet1"; std::string network_interface;
EthernetDevice device(device_name); node_->get_parameter("network_interface", network_interface);
RCLCPP_INFO(node_->get_logger(), "Network Interface: %s", network_interface.c_str());
EthernetDevice device(network_interface.c_str());
vanetza::MacAddress mac_address = device.address(); vanetza::MacAddress mac_address = device.address();
std::stringstream sout; std::stringstream sout;