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

REJOIN processing is coded fairly opaquely; remove gotos #237

Closed
terrillmoore opened this issue Mar 11, 2019 · 2 comments
Closed

REJOIN processing is coded fairly opaquely; remove gotos #237

terrillmoore opened this issue Mar 11, 2019 · 2 comments
Assignees

Comments

@terrillmoore
Copy link
Member

terrillmoore commented Mar 11, 2019

See also #165. REJOIN is useful for ADR. But the logic for processJoinAccept() is somewhat diffusely placed in the code, making it hard to see what's going on. Refactor so that processJoinAccept() is called in each slot, rather than having some code that is confusingly implicitly slot dependent.

processJoinAccept() is hard to maintain; it uses chained gotos that make the flow hard to perceive. While correcting this bug, change the routine to use sub-functions instead. It will add no noticeable overhead and it will make it much easier to maintain the code.

@terrillmoore terrillmoore self-assigned this Mar 11, 2019
@terrillmoore
Copy link
Member Author

Found while working on #215, and bug fix will be in that branch.

@terrillmoore terrillmoore changed the title REJOIN attempt stops on first downlink REJOIN processing is coded fairly opaquely. Mar 11, 2019
@terrillmoore terrillmoore changed the title REJOIN processing is coded fairly opaquely. REJOIN processing is coded fairly opaquely; remove gotos Mar 11, 2019
@terrillmoore
Copy link
Member Author

Change pushed in 86bec49 was tested in regression testing. Now that I understand how REJOIN is supposed to work, I don't think that it's wrong. May not meet the LoRaWAN spec, but... it meets the design. It now correctly triggers a on-time attempt to rejoin, which may or may not cause problems if the network sees it.

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

1 participant