-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Feat/6704 neighbor info on demand #8523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Feat/6704 neighbor info on demand #8523
Conversation
|
@thebentern Also weigh in on whether you need me to change anything. |
| // 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.