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

flaw in packetParser.cpp 'readPacket' rejects valid packets #23

Open
ScottFerg56 opened this issue Dec 20, 2016 · 3 comments · May be fixed by #32
Open

flaw in packetParser.cpp 'readPacket' rejects valid packets #23

ScottFerg56 opened this issue Dec 20, 2016 · 3 comments · May be fixed by #32

Comments

@ScottFerg56
Copy link

This file and function appear in three examples that I could find.

The 'readPacket' function resets the packet when a '!' byte is seen:
if (c == '!') { replyidx = 0; }
(line 101 after ble->read)
Unfortunately, '!' can be a valid value for a parameter or checksum byte in the packet. This flaw causes certain valid packets to be rejected with a "Checksum mismatch". For example, a color picker packet with any of the RGB values set to 33 ('!') will be rejected. Likewise a color picker packet whose RGB values sum to 122 will generate a checksum value of '!' and be rejected.

@petermichaux
Copy link

I agree this is confusing. It could very well be that a byte contains the value 33 as a color.

@petermichaux
Copy link

@hathach, any insights you can share on this?

@ladyada
Copy link
Member

ladyada commented Mar 16, 2017

hathach didnt write it, i did :)

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

Successfully merging a pull request may close this issue.

3 participants