@@ -24,7 +24,7 @@ rmw_ret_t rmw_uxrce_transport_init(
2424 void * transport )
2525{
2626#ifdef RMW_UXRCE_TRANSPORT_SERIAL
27- const char * serial_device = (NULL == context_impl ) ?
27+ const char * serial_device = (NULL == init_options_impl ) ?
2828 RMW_UXRCE_DEFAULT_SERIAL_DEVICE :
2929 init_options_impl -> transport_params .serial_device ;
3030
@@ -92,9 +92,6 @@ rmw_ret_t rmw_uxrce_transport_init(
9292 RMW_SET_ERROR_MSG ("rmw_transport_init SERIAL: invalid serial device file descriptor" );
9393 return RMW_RET_ERROR ;
9494 }
95- printf (
96- "micro-ROS transport: connected using serial mode, dev: '%s'\n" ,
97- serial_device );
9895#elif defined(RMW_UXRCE_TRANSPORT_UDP )
9996#ifdef RMW_UXRCE_TRANSPORT_IPV4
10097 uxrIpProtocol ip_protocol = UXR_IPv4 ;
@@ -105,25 +102,22 @@ rmw_ret_t rmw_uxrce_transport_init(
105102 uxrUDPTransport * udp_transport = (NULL == context_impl ) ?
106103 (uxrUDPTransport * )transport :
107104 & context_impl -> transport ;
108- const char * agent_ip = (NULL == context_impl ) ?
105+ const char * agent_ip = (NULL == init_options_impl ) ?
109106 RMW_UXRCE_DEFAULT_UDP_IP :
110107 init_options_impl -> transport_params .agent_address ;
111- const char * agent_port = (NULL == context_impl ) ?
108+ const char * agent_port = (NULL == init_options_impl ) ?
112109 RMW_UXRCE_DEFAULT_UDP_PORT :
113110 init_options_impl -> transport_params .agent_port ;
114111
115112 if (!uxr_init_udp_transport (udp_transport , ip_protocol , agent_ip , agent_port )) {
116113 RMW_SET_ERROR_MSG ("rmw_transport_init UDP: cannot init XRCE transport" );
117114 return RMW_RET_ERROR ;
118115 }
119- printf (
120- "micro-ROS transport: connected using UDP mode, ip: '%s', port: '%s'\n" ,
121- agent_ip , agent_port );
122116#elif defined(RMW_UXRCE_TRANSPORT_CUSTOM )
123117 uxrCustomTransport * custom_transport = (NULL == context_impl ) ?
124118 (uxrCustomTransport * )transport :
125119 & context_impl -> transport ;
126- void * args = (NULL == context_impl ) ?
120+ void * args = (NULL == init_options_impl ) ?
127121 rmw_uxrce_transport_default_params .args :
128122 init_options_impl -> transport_params .args ;
129123
0 commit comments