Fix #481, simplify and consolidate state machines #482
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.
Checklist (Please check before submitting)
Describe the contribution
Rework state machines such that all state changes are performed in the tick processor, rather than scattered around in various parts of PDU processing.
This removes many dependencies and assumptions about the order of arrival of PDUs and makes the protocol handling more robust and accurate per the blue book spec.
Notably, this fixes a number of important concerns:
The bottom line: all transactions will proceed through the state machine in the exact same way, whether class 1 or class 2, with transitions all handled in the same place and in a consistent manner, going through all the same checks and validations on every transition in every transaction, regardless of PDU arrival order. This greatly improves adherence to the CFDP protocol spec and ability to deal with imperfect PDU delivery.
Bonus item: The "closure request" feature of class 1 transfers now is supported and works in the engine. (Only missing part is a way to request it when initiating a Tx transaction)
Fixes #481
Testing performed
Execute various file transfers, class 1 and class 2.
Use python script to force protocol anomalies such as out-of-order PDUs and PDUs with errors, confirm correct handling.
Expected behavior changes
Listed above
System(s) tested on
Linux
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.