Skip to content

Conversation

@DaneEvans
Copy link
Contributor

Closes #6704

Allows you to requestneighbours from a node.

  • Node needs to have neighbourInfo turned on, but can have the interval set to 0.

  • Does not need to have sendViaLora == true.

  • Uses the 'want response' field with neighbor_count == 0 to indicate that it is a request for neighbor info.
    This doesn't seem to be being used by anything in neighbor info, but I added the count == 0 to make sure that we don't get into a situation where they just keep responding to each other.

Added an optional 'sendEmpty' param, so that requests are always responded to.

At the moment it's sent to the requesting node, rather than broadcast, but that's open to discussion.

@DaneEvans
Copy link
Contributor Author

@thebentern
I can't add labels - it's passing everything else.

Also weigh in on whether you need me to change anything.

@thebentern thebentern added the enhancement New feature or request label Nov 3, 2025
@thebentern thebentern requested a review from GUVWAF November 4, 2025 11:12
// If the hopLimit is the same as hopStart, then it is a neighbor
getOrCreateNeighbor(mp.from, mp.from, 0, mp.rx_snr); // Set the broadcast interval to 0, as we don't know it
}
if (mp.decoded.want_response && np->neighbors_count == 0) { // want response, and is otherwise empty.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want_response packets are handled in callModules(). The cleanest way to implement this is by overriding allocReply(). See e.g. the NodeInfoModule for an example. In this way, the correct request_id is also set, which the recipient uses to link to the request.

Copy link
Member

@GUVWAF GUVWAF Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also not use a 0 neighbor count for this, because it lets this node think the requester has 0 neighbors. For other requests, e.g. position, we send the requester's position with it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Pull Neighbor list remote

3 participants