mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 00:17: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;
|
||||
}
|
||||
|
||||
int res = publish(); // Initial broadcast
|
||||
if (res < 0)
|
||||
int res = -1;
|
||||
|
||||
if (!getNode().isPassiveMode())
|
||||
{
|
||||
goto fail;
|
||||
res = publish();
|
||||
if (res < 0) // Initial broadcast
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
res = gdr_sub_.start(GlobalDiscoveryRequestCallback(this, &NodeStatusProvider::handleGlobalDiscoveryRequest));
|
||||
|
||||
Reference in New Issue
Block a user