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

@@ -11,13 +11,12 @@
#include "ugv_sdk/utilities/stopwatch.hpp"
namespace westonrobot {
void ProtocolDectctor::Connect(std::string can_name) {
bool ProtocolDectctor::Connect(std::string can_name) {
can_ = std::make_shared<AsyncCAN>(can_name);
can_->SetReceiveCallback(
std::bind(&ProtocolDectctor::ParseCANFrame, this, std::placeholders::_1));
can_->StartListening();
return can_->StartListening();
}
void ProtocolDectctor::Connect(std::string uart_name, uint32_t baudrate) {}
ProtocolVersion ProtocolDectctor::DetectProtocolVersion(uint32_t timeout_sec) {
msg_v1_detected_ = false;