Check for frame key in data with multiple messages #5
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.
Change Description
It seems the current implementation of distributer in fprime-gds shown below assumes one single key_frame per data passed to distributer by on_recv():
https://github.com/fprime-community/fprime-gds/blob/0b2879a09a3b4f7e489ea2076188c0c0bfa99f43/src/fprime_gds/common/distributor/distributor.py#L89-L102
The code looks for the first occurrence of the key_frame and then it tries to read lengths until the end of the data.
The issue is when we pass the entire com file only the first message will be decoded. The reset of raw messages will be sliced incorrectly.
To resolve this issue (as proposed by @LeStarch) moved "the 'search for keyframe' block (lines 89-102) into the next while loop (105) as a first step."
Rationale
The intention is to "find a key frame, unparsed message, then search for keyframe again."
Testing/Review Recommendations
Ran a custom ComLog parser, passed entire ComLog to the distributer and was able to pars the binary file with no issue.
Ran GDS and was able to see log files in the browser.
Future Work
On the following line we might be able to replace Python list with generator to avoid loading the entire data into memory before start processing the data:
https://github.com/fprime-community/fprime-gds/blob/0b2879a09a3b4f7e489ea2076188c0c0bfa99f43/src/fprime_gds/common/distributor/distributor.py#L117