Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fjmolinas
Copy link
Contributor

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.

@fjmolinas
Copy link
Contributor Author

ping @TimothyClaeys :)

@fjmolinas
Copy link
Contributor Author

Do you think this might be of interest? The default logging I can change and guard the rest depending on the logging level.

@fjmolinas
Copy link
Contributor Author

Maybe @malishav could take a look?

Copy link
Contributor

@malishav malishav left a 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.

inc/opendefs.h Show resolved Hide resolved
SConstruct Outdated Show resolved Hide resolved
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
Copy link
Contributor

Choose a reason for hiding this comment

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

see comment above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove

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) |
Copy link
Contributor

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.

@@ -681,6 +682,14 @@ void registerNewNeighbor(open_addr_t *address,
if (rssi < GOODNEIGHBORMINRSSI) {
break;
}
open_addr_t addr_16;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved up as suggested

@fjmolinas fjmolinas force-pushed the pr_improve_logs_info branch from 0e046b0 to 5645407 Compare June 24, 2021 15:47
@fjmolinas fjmolinas force-pushed the pr_improve_logs_info branch from 5645407 to 547597d Compare June 24, 2021 15:48
@malishav
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants