Commit b32ef64d authored by Sergi Hernandez's avatar Sergi Hernandez

Solved a bug when the first attempt to configure the bus failed (the...

Solved a bug when the first attempt to configure the bus failed (the communications object was not properly handled).
parent a622b90c
......@@ -41,15 +41,18 @@ void CDynamixelServerSerial::config_bus(const std::string &device, int baudrate)
{
TRS232_config serial_config;
serial_config.baud=baudrate;
serial_config.num_bits=8;
serial_config.parity=none;
serial_config.stop_bits=1;
this->comm_dev=new CRS232(device);
this->comm_dev->open((void *)&device);
this->comm_dev->config(&serial_config);
this->bus_info.baud_rate=baudrate;
this->bus_info.device=device;
if(this->comm_dev==NULL)
{
serial_config.baud=baudrate;
serial_config.num_bits=8;
serial_config.parity=none;
serial_config.stop_bits=1;
this->comm_dev=new CRS232(device);
this->comm_dev->open((void *)&device);
this->comm_dev->config(&serial_config);
this->bus_info.baud_rate=baudrate;
this->bus_info.device=device;
}
}
#ifdef _HAVE_XSD
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment