This repository has been archived by the owner on May 6, 2024. It is now read-only.
Parse goesrecv symbols to remove stray nanomsg headers #9
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.
First off, I want to say a big THANK YOU for writing this program! Its code helped me understand how nanomsg works "on the wire", and I've written a number of goesrecv-related programs thanks to it. So, I wanted to give back.
In goesrecv-monitor v1.3, Symbols.cs is treating the nanomsg TCP stream as a stream of raw symbols. Unfortunately, nanomsg isn't quite that simple. It has 64-bit unsigned integer "headers" throughout the data stream that announce how many bytes are coming next. See section 3 at https://github.com/nanomsg/nanomsg/blob/master/rfc/sp-tcp-mapping-01.txt for more info.
To fix the problem, this PR reads the 64-bit integer (8 bytes), then only draws as many bytes as nanomsg announced is coming. Afterwards, it reads the next 8 bytes as another header (since it must be), and repeats the process.
Admittedly, the constellation diagram does not look that much different on my system, but if others reference your project like I did, this code is a more accurate starting point.
The code for this is essentially copied and pasted from my own goesbetween project - it's much more necessary to strip out the nanomsg headers when you're pulling the baseband iq samples!