-
Notifications
You must be signed in to change notification settings - Fork 241
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
inc/opendefs: add new neighbors logging #539
base: develop
Are you sure you want to change the base?
inc/opendefs: add new neighbors logging #539
Conversation
ping @TimothyClaeys :) |
Do you think this might be of interest? The default logging I can change and guard the rest depending on the logging level. |
Maybe @malishav could take a look? |
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.
A couple of comments inline.
SConstruct
Outdated
@@ -186,7 +186,7 @@ command_line_vars.AddVariables( | |||
( | |||
'logging', # key | |||
'', # help | |||
command_line_options['logging'][5], # default | |||
command_line_options['logging'][6], # default |
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.
see comment above
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'll remove
openstack/02b-MAChigh/neighbors.c
Outdated
open_addr_t addr_16; | ||
addr_16.type = ADDR_16B; | ||
packetfunctions_mac64bToMac16b(address, &addr_16); | ||
uint16_t short_addr = ((addr_16.addr_16b[0] << 8) & 0xff00) | |
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 was thinking here whether we did this sort of conversion from ADDR_16B
type to a uint16
anywhere else in the code but did not find a similar use case. a short address is logged for ERR_NO_NEXTHOP
but that implementation requires two arguments which is not applicable to your case since you want to log both the short address and the RSSI. With that in mind, I am ok with this approach.
openstack/02b-MAChigh/neighbors.c
Outdated
@@ -681,6 +682,14 @@ void registerNewNeighbor(open_addr_t *address, | |||
if (rssi < GOODNEIGHBORMINRSSI) { | |||
break; | |||
} | |||
open_addr_t addr_16; |
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.
the convention we use is to declare variables at the beginning of the function, one var per line. applies throughout.
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.
So you want me to move it up to line 669? AFAIU putting it inside the iff reduces its scope to where it's needed, but I can move it up if you prefer.
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.
Moved up as suggested
0e046b0
to
5645407
Compare
5645407
to
547597d
Compare
@fjmolinas thanks for doing the changes. Before I merge, could you rebase this on top of the latest develop and confirm what you have tested locally? The failing build seems unrelated. |
This PR adds some information about the new neighbor RSSI, it was useful for me to realize that
nodes at the same distance where hearing the same nodes with a huge RSSI penalty.