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

Enhance checkConnection() function #240

Merged
merged 4 commits into from
Jun 16, 2024
Merged

Enhance checkConnection() function #240

merged 4 commits into from
Jun 16, 2024

Conversation

TMRh20
Copy link
Member

@TMRh20 TMRh20 commented Jun 16, 2024

  • Define MESH_CONNECTION_CHECK_ATTEMPTS in RF24Mesh_config.h & add doc info

checkConnection() function:

  • Return from checkConnection() if -2 received (not in list or default address)
  • retry if -1 (write failed or timed out)
  • success if address matches
  • fail otherwise

This should enhance stability a bit by raising the connection check attempts to 3.

It should also enhance the actual connection check by returning immediately and not retrying if a -2 is received (not in list or default address).

Furthermore it actually verifies that the returned RF24Network address matches the existing RF24Network address.

- Define MESH_CONNECTION_CHECK_ATTEMPTS
- Return from checkConnection() if -2 received, retry if -1, success if address matches, fail otherwise
@TMRh20 TMRh20 requested a review from 2bndy5 June 16, 2024 11:48
Copy link
Member

@2bndy5 2bndy5 left a comment

Choose a reason for hiding this comment

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

I don't think a return statement needs to be followed by a break statement in a switch block.

RF24Mesh_config.h Outdated Show resolved Hide resolved
TMRh20 and others added 2 commits June 16, 2024 05:57
Co-authored-by: Brendan <2bndy5@gmail.com>
RF24Mesh.cpp Outdated Show resolved Hide resolved
@TMRh20 TMRh20 merged commit 7827e87 into master Jun 16, 2024
21 checks passed
@TMRh20 TMRh20 deleted the CheckConnection branch June 16, 2024 12:44
2bndy5 added a commit that referenced this pull request Jun 16, 2024
* Modify checkConnection()

- Define MESH_CONNECTION_CHECK_ATTEMPTS
- Return from checkConnection() if -2 received, retry if -1, success if address matches, fail otherwise

* Update RF24Mesh_config.h

Co-authored-by: Brendan <2bndy5@gmail.com>

* Remove breaks; from switch

- Per @2bndy5 in #240

* Update comment

---------

Co-authored-by: Brendan <2bndy5@gmail.com>
@2bndy5
Copy link
Member

2bndy5 commented Jun 16, 2024

cherry-picked to v1.x

@2bndy5
Copy link
Member

2bndy5 commented Jun 16, 2024

Did you want to try that new bump-n-release workflow? Or do you have some more pleasant surprises in store?

@TMRh20
Copy link
Member Author

TMRh20 commented Jun 16, 2024

I'm planning to do a little more coding over the next week or so, so lets see if I come up with anything else. This one I just came across while glancing at the code...

2bndy5 added a commit to nRF24/CircuitPython_nRF24L01 that referenced this pull request Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants