[ebus-dev] CSMA/CD test code
Werner Koch
wk at gnupg.org
Mon Aug 22 21:46:53 CEST 2011
On Mon, 22 Aug 2011 16:51, johnd at autoartisans.com said:
> This is a great example of why I insist people comment their code. Even
> just the quick and dirty programs. The comments either say what the
I did:
/* The sync byte which indicates the start of a new message. If this
byte is used inside the message it needs to be escaped and ORed
with the escape mask. This ensures that a sync byte will always be
the start of a new frame. Note that this is similar to the PPP
(rfc-1662) framing format. */
#define FRAMESYNCBYTE 0x7e
#define FRAMEESCBYTE 0x7d
#define FRAMEESCMASK 0x20
Need to fix the bug which confused you: s/ORed/XORed/
Salam-Shalom,
Werner
--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
More information about the Ebus-dev
mailing list