Skip to content

Commit

Permalink
Add boot timeout (1s)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellmann Santos <[email protected]>
  • Loading branch information
Christoph Hellmann Santos committed Oct 13, 2023
1 parent 90cd582 commit 856a947
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions canopen_base_driver/src/lely_driver_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ std::string LelyBridgeErrCategory::message(int ev) const
case LelyBridgeErrc::SerialNumberDifference:
return "Value of object 1018:04 from CANopen device is different to value in object 1F88 "
"(Serial number).";
case LelyBridgeErrc::TimedOut:
return "The boot configure process timed out (took more than 1 second).";
default:
return "(unrecognized error)";
}
Expand Down Expand Up @@ -112,6 +114,18 @@ void LelyDriverBridge::OnBoot(canopen::NmtState st, char es, const ::std::string
boot_cond.notify_all();
}

void LelyDriverBridge::OnConfig(::std::function<void(::std::error_code ec)> res) noexcept
{
std::cout << "OnConfig" << std::endl;
this->SubmitWait(
std::chrono::seconds(10),
[this, res](std::error_code ec)
{
std::cout << "OnConfig" << std::endl;
FiberDriver::OnConfig(res);
});
}

void LelyDriverBridge::OnRpdoWrite(uint16_t idx, uint8_t subidx) noexcept
{
lely::COSub * sub = this->dictionary_->find(idx, subidx);
Expand Down

0 comments on commit 856a947

Please sign in to comment.