Suppose I get from the network a sequence of bytes in the following order:
X X X X = X X X X = X X X X = ... and so on
you can notice immediately the pattern (a message is a sequence of 5 bytes: "X X X X =
X can be any number except '=' of course)
Now, the transmission occur periodically. In some point my application is starting and getting the bytes sequence
What is the best algorithm for taking those bytes and framing them to 5 bytes messages?
There are two problems:
1. How do you find the first message? I guess I need to drop some bytes till I get '=' right?
2. How the application suppose to handle a pause of transimmision and a new start.