terça-feira, 19 de outubro de 2010

RF Links Reliable Messaging (Part 2)

Some people asked for the specification of the protocol and i decided to write a post on it and clarify it a little bit more. So first of all the next picture represents the message packet of the protocol, it has 6 bytes described below.

Protocol packet

And here'a sequence diagram that represents the exchange of messages in a situation where the first reply is lost. We can see that the transmitter then retransmit the same message, in this case the receiver realizes it is the same message it received a while ago and sends a reply again, this time succesflly.

Protocol sequece diagram
I hope it helps in the understanding and will be of great help for other who wish to implement it in other languages. I ask you guys to let me know of any doubts and any criticism (hope it's written right) will be welcome.
So, for those interessed, i'm working now in a second version of it using CRC16 for error detection instead of checksum. And here's a nice link to a Hack A Day post where some debate is going on on my post, pretty nice arguments by the way.

2 comments:

wtf disse...

Wow, I didn't expect such a output :)
As CVBruce said, which benefit has a random ID?
Another thing I'm thinking about is... a 16bit checksum for 1 byte payload?

Arduitter disse...

@wft, hope it is what you were expecting.
I didn't think of the random number as a benefit, i just thought about using it and implemented. I'll give it some attention.
Yeah, a 16 bit can be too much now, but what if the need changes and i (or someone else) have to send more than 1 byte?

Postar um comentário