Binary protocol over bluetooth#82
Binary protocol over bluetooth#82raduiliescu wants to merge 5 commits intoStephenBlackWasAlreadyTaken:masterfrom
Conversation
add support to extract int16, uint16 and uint8 from a byte array java doesn't have support for unsigned this is required for having binary, reliable & extensible communication protocol between wixel and android
currently it contains only DATA_PACKET type
add support for decoding binary data packets required for having binary reliable and extensible communication protocol between wixel and android
create a packet read state machine DexCollectionServices 1. read packet type 2. read len 3. do read until len bytes are read if packet is malformed (unknown, an invalid len, too long or short), the state machine will be restarted tested with all above malformed cases; tested with a mix of random bad/good packets.
There was a problem hiding this comment.
First off, this PR is super cool, my biggest issue is that I dont want an app update to make someones currently functional wixel stop being able to communicate with xDrip, can we split this setSerialDataToTransmitterRawData and have it go down two logical paths, one if its the old style, one if its the new style,
Also I would love it if the start of each of these new packets was a version number (this being version 1, that way if we down the road add in some more params we can easily check which version of the a transmitter data parser to use)
There was a problem hiding this comment.
Have added a fallback mechanism see line 397
|
Consider using something like protocol buffers [1] or thrift [2] instead of manually versioning the binary protocol [1] https://developers.google.com/protocol-buffers/docs/overview |
|
In general I have some issues with keeping backwords compatibility. Can be a big pain on new development. On versioning I see two possibilities:
Please let me know of your thoughts. |
|
on versioning: adding a library to the wixel will be tough, its very tight on space and bceause its so timing dependant I would like to keep from having to jam anything that happens in the main loop from having to touch xdata |
|
Ok. Will implement it to allways be backwords compatible. |
|
moved StephenBlackWasAlreadyTaken/xDrip-Experimental#12 for rebasing |
Change data exachange over bluetooth to a binary format.
Advantages: