Skip to content
Snippets Groups Projects
Commit b32ef64d authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -41,15 +41,18 @@ void CDynamixelServerSerial::config_bus(const std::string &device, int baudrate) ...@@ -41,15 +41,18 @@ void CDynamixelServerSerial::config_bus(const std::string &device, int baudrate)
{ {
TRS232_config serial_config; TRS232_config serial_config;
serial_config.baud=baudrate; if(this->comm_dev==NULL)
serial_config.num_bits=8; {
serial_config.parity=none; serial_config.baud=baudrate;
serial_config.stop_bits=1; serial_config.num_bits=8;
this->comm_dev=new CRS232(device); serial_config.parity=none;
this->comm_dev->open((void *)&device); serial_config.stop_bits=1;
this->comm_dev->config(&serial_config); this->comm_dev=new CRS232(device);
this->bus_info.baud_rate=baudrate; this->comm_dev->open((void *)&device);
this->bus_info.device=device; this->comm_dev->config(&serial_config);
this->bus_info.baud_rate=baudrate;
this->bus_info.device=device;
}
} }
#ifdef _HAVE_XSD #ifdef _HAVE_XSD
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment