mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 03:43:35 +08:00
libuavcan passive mode support
This commit is contained in:
@@ -62,10 +62,15 @@ int NodeStatusProvider::startAndPublish()
|
||||
return -ErrNotInited;
|
||||
}
|
||||
|
||||
int res = publish(); // Initial broadcast
|
||||
if (res < 0)
|
||||
int res = -1;
|
||||
|
||||
if (!getNode().isPassiveMode())
|
||||
{
|
||||
goto fail;
|
||||
res = publish(); // Initial broadcast
|
||||
if (res < 0)
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
res = gdr_sub_.start(GlobalDiscoveryRequestCallback(this, &NodeStatusProvider::handleGlobalDiscoveryRequest));
|
||||
@@ -80,7 +85,10 @@ int NodeStatusProvider::startAndPublish()
|
||||
goto fail;
|
||||
}
|
||||
|
||||
TimerBase::startPeriodic(MonotonicDuration::fromMSec(protocol::NodeStatus::PUBLICATION_PERIOD_MS));
|
||||
if (!getNode().isPassiveMode())
|
||||
{
|
||||
TimerBase::startPeriodic(MonotonicDuration::fromMSec(protocol::NodeStatus::PUBLICATION_PERIOD_MS));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user