mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 16:43:35 +08:00
Properly handling the initial node status broadcast in passive mode
This commit is contained in:
@@ -69,10 +69,15 @@ int NodeStatusProvider::startAndPublish()
|
|||||||
return -ErrNotInited;
|
return -ErrNotInited;
|
||||||
}
|
}
|
||||||
|
|
||||||
int res = publish(); // Initial broadcast
|
int res = -1;
|
||||||
if (res < 0)
|
|
||||||
|
if (!getNode().isPassiveMode())
|
||||||
{
|
{
|
||||||
goto fail;
|
res = publish();
|
||||||
|
if (res < 0) // Initial broadcast
|
||||||
|
{
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res = gdr_sub_.start(GlobalDiscoveryRequestCallback(this, &NodeStatusProvider::handleGlobalDiscoveryRequest));
|
res = gdr_sub_.start(GlobalDiscoveryRequestCallback(this, &NodeStatusProvider::handleGlobalDiscoveryRequest));
|
||||||
|
|||||||
Reference in New Issue
Block a user