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

compute CRC on all bytes (apart from start, stop and CRC byte of course) #100

Open
uncle-buzz opened this issue Nov 25, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@uncle-buzz
Copy link

First, thank you for your library, it is very helpful!

It just lacks documentation to fully understand capabilities and usage (more than the simples examples provided), for example, the COBS stuffing on the start byte value is not well described until you read the Packet::stuffPacket or Packet::unpackPacket (I first used some COBS code for '0' value in my C# application until I understood why it was not working).

Nevermind.

If I'm not wrong, the CRC byte is computed on the payload bytes only (after COBS encoding).

But what if some other bytes are corrupted?
I mean, if the COBS overhead byte is corrupted, CRC checking will succeed, but the COBS decoding will fail and will give unpredictable results.
What if the ID byte is corrupted? CRC and COBS will succeed (if there is no other corruption of course) and will give an unpredictable result depending on the ID usage in our software.

Why not compute the CRC byte on the whole bytes from ID to end of payload? The start byte can't be corrupted or reception is not possible, the stop byte can't be corrupted or the reception will be canceled so there's no need to check those bytes.

It's very unlikely to have only one of those 2 bytes corrupted, but the CRC checking is to ensure no byte is corrupted, I wonder why not include those bytes.

@PowerBroker2 PowerBroker2 added the question Further information is requested label Nov 27, 2022
@PowerBroker2 PowerBroker2 self-assigned this Nov 27, 2022
@uncle-buzz
Copy link
Author

Additionally, doing a CRC check on ID, COBS and size bytes could give the ability to send void payloads and still be able to CRC the message where only ID is the useful data like requested here: #88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants