Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boot timeout and retry #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading