-
Notifications
You must be signed in to change notification settings - Fork 97
Initial rust implementation #714
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
Conversation
… type that is capable to reading from a stream and buffering the data across multiple calls to parse.
This comment has been minimized.
This comment has been minimized.
Removed generating before testing for rust
|
Here are some remaining open questions I have:
|
35dfd5f to
bd6d619
Compare
|
Here is a todo list:
These don't have to be addressed in this PR, but should probably be tracked somewhere. As github issues maybe? |
|
On Jul 22, 2019, at 9:31 AM, Joseph Angelo ***@***.***> wrote:
Here are some remaining open questions I have:
Do we want to publish this to crates.io immediately? (Could see an argument to work with it a bit internally before publishing)
I think we can go either way here, I haven’t seen any external demand for this, so publishing would be for our own internal convenience. Also, I’m not sure it adds that much convenience since Cargo can easily build and use crates directly from GitHub. So, the benefit of publishing would just be an easier installation line in `Cargo.toml`, and having the docs published on docs.rs <http://docs.rs/> automatically. If we publish, we can also state in the release that it’s a pre-release or alpha, and state explicitly what the functionality is, in order to manage expectations.
If we want to publish to crates.io, do we want to do that manually or have travis do it?
All other publishing is manual at the moment, so it makes sense for this to be too, at the moment.
Do we see much benefit in generating tests from the YAML spec?
If it’s not terribly hard I don’t think it’ll hurt since it would provide a better idea that the parsing is correct across all of the message types. If we have some other way of convincing ourselves that the parsing is correct (via sbp2json output like we did for the Python JIT support) then I think we can avoid it.
|
|
On Jul 22, 2019, at 9:59 AM, Joseph Angelo ***@***.***> wrote:
...
These don't have to be addressed in this PR, but should probably be tracked somewhere. As github issues maybe?
GitHub issues that don’t get tracked internally don’t tend to get worked on :-)
|
rust/sbp/Cargo.toml
Outdated
| [dependencies] | ||
| byteorder = "1.2.1" | ||
| crc16 = "*" | ||
| nom = "5.0.0-beta2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need a beta version of nom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not any more. Apparently version 5.0 has been released since I started work on this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's fix this up and merge.
|
@silverjam I'll leave figuring out about publishing to crates.io for later then. I'd prefer to get at least one internal project using this to fix out the major issues before pushing it out to the general public. And for the tests, do you want to see them in this PR? I can work on adding them, but it'll take some time. |
silverjam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we'll add generated tests in a subsequent PR

I scaled back my initial intentions, this is a few small tweaks on top of Gareth's SBP message generator work. I added a sender ID field to each full message struct, and added a very bare bones
SBPMessagetrait which has a message type constant, and functions for getting and setting the sender ID.In addition to the message structure I added a simple parser type that reads through a source and tries to extract an SBP message. It's similar to the C parser, except that it buffers data, to try and avoid system call overhead.
Currently there is only parsing capabilities implemented. Eventually it would be nice to add a function to the
SBPMessagetrait to convert the message into aVec<u8>, essentially a complete SBP frame.