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

"Clear counts" on rfm69 does not reset node count properly. #1239

Closed
Trickx opened this issue Oct 1, 2018 · 5 comments
Closed

"Clear counts" on rfm69 does not reset node count properly. #1239

Trickx opened this issue Oct 1, 2018 · 5 comments

Comments

@Trickx
Copy link
Contributor

Trickx commented Oct 1, 2018

Issue: If the button "Clear counts" is pressed, the node count on the status page does not start to count anymore.

Reason: The reset code does not reset .count.

void _rfm69Clear() {
    for(unsigned int i=0; i<255; i++) {
        _rfm69_node_info[i].duplicates = 0;
        _rfm69_node_info[i].missing = 0;
    }
    _rfm69_node_count = 0;
    _rfm69_packet_count = 0;
}

Solution:

void _rfm69Clear() {
    //for(unsigned int i=0; i<255; i++) {
    for(unsigned int i=0; i<(sizeof(_rfm69_node_info)/sizeof(_node_t)); i++) {
        _rfm69_node_info[i].duplicates = 0;
        _rfm69_node_info[i].missing = 0;
        _rfm69_node_info [i].count = 0;
    }
    _rfm69_node_count = 0;
    _rfm69_packet_count = 0;
}
@lobradov
Copy link
Contributor

lobradov commented Oct 1, 2018 via email

@Trickx
Copy link
Contributor Author

Trickx commented Oct 1, 2018

I would, but my espurna-fork is currently being used for other features - not ready for PR.
That's why I posted the fixed code here.

@lobradov
Copy link
Contributor

lobradov commented Oct 1, 2018 via email

Trickx added a commit to Trickx/espurna that referenced this issue Oct 1, 2018
Trickx added a commit to Trickx/espurna that referenced this issue Oct 1, 2018
@Trickx
Copy link
Contributor Author

Trickx commented Oct 1, 2018

-> PR #1241

@xoseperez
Copy link
Owner

Merged into dev. Thank you!

@xoseperez xoseperez added this to the 1.13.3 milestone Oct 5, 2018
xoseperez added a commit that referenced this issue Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants