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

What is the motivation for starting GATT values with '!'? #31

Closed
tedhenry100 opened this issue Mar 16, 2017 · 8 comments
Closed

What is the motivation for starting GATT values with '!'? #31

tedhenry100 opened this issue Mar 16, 2017 · 8 comments

Comments

@tedhenry100
Copy link

In the examples, it is not documented why the packet reading code requires all GATT values to begin with the '!' character.

Especially curious is why the replyidx is reset when a second '!' character is encountered in the value. What if a '!' character is actually intended to be part of the value the master device is trying to send to the BluefruitLE?

@ladyada
Copy link
Member

ladyada commented Mar 16, 2017

make parsing easier, so you know where to start looking - and then you checksum as well!

@ladyada ladyada closed this as completed Mar 16, 2017
@petermichaux
Copy link

petermichaux commented Mar 16, 2017

@ladyada ,

"so you know where to start looking"

If what follows the '!' is the meaningful part of the value sent to the device, is there something in the value that could reasonably come before the '!' character?

@petermichaux
Copy link

I see that issue #23 brings up the same point about resetting when '!' is seen somewhere in the middle of the value. That character might be part of the value rather than the start of the value.

@ladyada
Copy link
Member

ladyada commented Mar 16, 2017

that codes probably before the checksum was added. there needs to be some way to know when a packet starts! :)

@tedhenry100
Copy link
Author

@ladyada, doesn't data arriving indicate a packet starting?

@ladyada
Copy link
Member

ladyada commented Mar 16, 2017

no, not necessarily, bytes can be dropped by the uart interface

@tedhenry100
Copy link
Author

@ladyada, so some of the bytes at the start of the packet could be dropped meaning only the tail of the packet is being read?

That still doesn't explain resetting replyidx part way through reading a packet. Can two packets be mashed/merged together requiring the reset? If so, what if the '!' character really is part of the data in the middle of the package.

Thanks for your replies. I appreciate it. :-)

@ladyada
Copy link
Member

ladyada commented Mar 16, 2017

yes, if you want to submit a pull req for the fix that would be nice - no ETA on when we'll get to it!

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