async_port: fixed return error in SetupPort()

This commit is contained in:
Ruixiang Du
2021-09-02 16:51:31 +08:00
parent a63b25cc1f
commit af27fa2772
8 changed files with 43 additions and 33 deletions

View File

@@ -34,9 +34,10 @@ class AsyncPortBase {
io_thread_ = std::thread([this]() { io_context_.run(); });
return true;
}
std::cerr << "Failed to setup port, please check if specified port exits "
"or if you have proper permissions to access it"
<< std::endl;
std::cerr
<< "[ERROR] Failed to setup port, please check if specified port exits "
"or if you have proper permissions to access it"
<< std::endl;
return false;
};
virtual void StopService() {}

View File

@@ -18,8 +18,7 @@
namespace westonrobot {
class ProtocolDectctor {
public:
void Connect(std::string can_name);
void Connect(std::string uart_name, uint32_t baudrate);
bool Connect(std::string can_name);
ProtocolVersion DetectProtocolVersion(uint32_t timeout_sec);