Skip to content

Notify packet size/timeout #8

Answered by RoySalisbury
RoySalisbury asked this question in Q&A
Discussion options

You must be logged in to vote

I ended up just appending all bytes received from the notification to a buffer and then writing a packet assembler to look for the packet header .. then decoding form there to determine how many bytes I needed. Once I found the right "full packet" I removed that data from the start of the buffer and fired a separate event handler withe just the full packet bytes.

Took me a bit to figure out the ins-outs of the library, but now that I have, I have a working system that reads/writes data to the device.

Working around everything being "async" with out a way to pass a cancellationToken is a pain, but for the long running things I've got a pattern working. That is until DBus or BlueZ locks up.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DamianSuess
Comment options

@RoySalisbury
Comment options

Answer selected by DamianSuess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants