Implement GAP scan in ClaimToken state#28
Merged
Merged
Conversation
This is in preparation for later reusing this code during claim token processing where we will need to perform a full gap-poll as well.
This is in preparation for later reusing this code during claim token processing where we will need to perform a full gap-poll as well. Currently, the implementation plays it safe and any bad telegram we receive will cause the active station to back off from the bus. We should probably differentiate here in the future and only back off when a different station responds.
The slot_time_timing() test should not expect the active station to respond with a token telegram after the status request. This may not always be the case, for example when the status request is sent as part of a claim-token gap poll.
After claiming a lost token, the active station must immediately scan its full GAP before stating to make use of the token. Implement this using the factored out GAP scanning logic from the previous commits.
Ensure the active station peforms a full GAP scan before doing anything else after claiming a lost token.
After claiming a lost token, the active station performs a full GAP scan. When this completes, it must pass on the token to the next active station immediately, instead of starting to make use of the token itself. Also ensure this behavior using the test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After claiming a lost token, the active station is required to perform a full GAP scan to immediately find the next station (NS). Right now, the next station is only acquired late when the "passive" GAP poll stumbles upon it.
Factor out the GAP poll logic and reuse it to GAP scan in the ClaimToken state.
Also immediately pass the token to the NS after this scan completes, rather than starting with using the token.
Fixes #25.