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

Document how to use CRC combined with COBS #117

Open
FrozenDroid opened this issue Nov 15, 2023 · 2 comments
Open

Document how to use CRC combined with COBS #117

FrozenDroid opened this issue Nov 15, 2023 · 2 comments

Comments

@FrozenDroid
Copy link

FrozenDroid commented Nov 15, 2023

Thanks for this crate. It looks really promising!

However, I'm running into a snag:
Serializing a message using COBS with included CRC is obvious; the deserialization is not at all.
CobsAccumulator only takes a T type parameter which is Deserialize, so I can't wrap any extra flavors in. I also haven't found a way on how to get a slice out of the accumulator. Using &[u8] or heapless::Vec as the T doesn't work; it always returns an empty slice.

@tomhampshire
Copy link

@FrozenDroid I'm trying to do exactly the same, serialize using COBS with included CRC, then deserialize using COBS with included CRC. Did you get this working? Would you be able to provide a working example, if so? Perhaps this example could then also be included in the repo docs.

@jamesmunns
Copy link
Owner

It's very possible that you can't use CobsAccumulator and CRC out of the box for the reasons mentioned here.

I might suggest copy and pasting and modifying CobsAccumulator into your project (it's only a few hundred lines) for now, though I would be happy to consider a version that handles flavors better for postcard 2.0! (cc #128)

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

No branches or pull requests

3 participants