View Single Post
  #3   Spotlight this post!  
Unread 04-08-2006, 08:47
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Distinguish Serial Data?

If the other device is known, like a keyboard, you could pick a starting flag byte that wont be used by the other device.

or the number of bytes you use for the flag (start characters) will determine the probability that stream will happen by random chance.

If you use an 8 bit start flag, the probability is 2^8 = 256:1

two bytes: 65,536:1

four bytes: 4.29 billion to one

your SW would then have to keep track - once you see the start flag you take the rest of the data as data. This implies you know how long the data packet will be.