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

Check for frame key in data with multiple messages #5

Merged
merged 1 commit into from
Jun 17, 2021
Merged

Check for frame key in data with multiple messages #5

merged 1 commit into from
Jun 17, 2021

Conversation

saba-ja
Copy link
Contributor

@saba-ja saba-ja commented Jun 17, 2021

Originating Project/Creator fprime-gds
Affected Component common/distributer
Affected Architectures(s) -
Related Issue(s) -
Has Unit Tests (y/n) No
Builds Without Errors (y/n) Yes
Unit Tests Pass (y/n) NA
Documentation Included (y/n) No

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

@LeStarch LeStarch merged commit fe25cbe into nasa:devel Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants