mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 23:33:38 +08:00
Added IAdHocNodeStatusUpdater
This commit is contained in:
@@ -34,6 +34,11 @@ void NodeStatusProvider::handleTimerEvent(const TimerEvent&)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ad_hoc_status_updater_ != UAVCAN_NULLPTR)
|
||||
{
|
||||
ad_hoc_status_updater_->updateNodeStatus();
|
||||
}
|
||||
|
||||
const int res = publish();
|
||||
if (res < 0)
|
||||
{
|
||||
@@ -109,6 +114,11 @@ uavcan::MonotonicDuration NodeStatusProvider::getStatusPublicationPeriod() const
|
||||
return TimerBase::getPeriod();
|
||||
}
|
||||
|
||||
void NodeStatusProvider::setAdHocNodeStatusUpdater(IAdHocNodeStatusUpdater* updater)
|
||||
{
|
||||
ad_hoc_status_updater_ = updater; // Can be nullptr, that's okay
|
||||
}
|
||||
|
||||
void NodeStatusProvider::setHealth(uint8_t code)
|
||||
{
|
||||
node_info_.status.health = code;
|
||||
|
||||
Reference in New Issue
Block a user