-
Notifications
You must be signed in to change notification settings - Fork 2
Implement file transfer thread #468
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
Merged
Merged
Conversation
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
ff3a3f6
to
36e3ba4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #468 +/- ##
==========================================
- Coverage 90.57% 90.33% -0.25%
==========================================
Files 120 122 +2
Lines 6613 6767 +154
Branches 310 320 +10
==========================================
+ Hits 5990 6113 +123
- Misses 623 654 +31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3bec62d
to
c2709ab
Compare
f75c38e
to
2387150
Compare
We can only send a single frame at once in the RF communication thread, so we can always use the `tmBuffer` and don't need a second one (or a local variable as it was in this case).
It is not necessary to send the whole channel access data unit, since the attached sync marker is the same for all TM frames. Therefore it is enough to send the encoded frame from the file transfer thread to the RF communication thread.
Yes, I know, this seems like the obvious thing to do but I still forgot it.
This file transfer info allows the RF communication thread to discard received PDUs early if no transfer is active, the sequence number is not the active one, or the direction or entity IDs are wrong. The status and sequence number are also added to the telemetry record.
This is done because the attached sync marker is stored as a constant in the internal flash which is not corrupted as fast as the buffer in RAM.
d5c4787
to
9523167
Compare
We forgot the directive codes. Also fix the tests.
If we cancel the transfer we immediately set the status to canceled, but we still wait for an ACK from the ground station.
Since we use a default RF data rate of 9600 Bd in stead of 1200 Bd now, a 5 s margin is way too much.
Previously, we only received additional data if we had time for the full RX time of 3 s plus data handling. Now, we reduced this to a min. RX time of 1 s plus data handling. The current implementation, however, is too simple and does not compute the remaining RX time at all. Therefore, a beacon can be sent up to 2 s too late. This is not too big of a deal, though, especially since it will only happen if we want to receive "the whole time".
This allows us to create and resize the file before the file transfer starts, which is important because the time it takes to resize depends on the file size. According to the file system benchmark it takes ~23 s to resize a file from 0 B to 1 MiB.
9523167
to
dc2bc71
Compare
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.
Fixes #384