To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 5226
5225  |  5227
Subject: 
Re: Lego Network Protocol questions
Newsgroups: 
lugnet.robotics.rcx.legos, lugnet.robotics
Date: 
Sun, 6 Jun 1999 02:40:20 GMT
Viewed: 
418 times
  
Regarding the IR protocol, I have elsewhere suggested the following simple
low-level format:

1 start, 1 stop, 2400 baud, odd parity

55 f0 f0 L ~L D1 ~D1 .. Dn ~Dn C ~C

L is number of data bytes, valid range 1..255, less depending on buffer sizes
Dx are data bytes, 1..n, n=L
C is checksum byte, sum (x=1..n) Dx

This format was chosen because it is simple and extensible; you are
supposed to build another protocol (e.g. the LNP) on top of it.

The 55 f0 f0 header was chosen because (unlike the original 55 ff 00), it
cannot appear in any part of a valid message except at the start.  Also, it
is different from 55 ff 00, so an RCX running the standard firmware will
not get confused as often.  The disadvantage of a new header is that
you need to modify existing software (e.g. send.c) to talk to the RCX with
the new format.

L was chosen to be a single byte because most messages are likely to be
smaller than 256 bytes and because large transmissions should probably be
split anyways - a 255 byte message takes about 2.4 seconds to transmit at
2400 baud.  Also, larger messages require larger buffers inside the RCX.

A different implementation might choose to use the original 55 ff 00 header
instead.  Even with the 55 ff 00 header, it would be difficult to confuse
the standard RCX firmware, since (for the most part) you'd need a checksum
error to do this.  Note that messages with lengths 1-5 would not need a
checksum error, but since 1-5 are not valid firmware opcodes, these
messages would be ignored and would not confuse anybody.

I have implemented code to support this format for an unreleased version of
Librcx, and am of course willing to share source code.  I am hoping that
other people will either use this format or point out its deficiencies so
the format can be fixed.

-Kekoa



Message has 1 Reply:
  Re: Lego Network Protocol questions
 
(...) I forgot to mention that one possible deficiency is the complements. They can be eliminated, for the most part, with careful counting of zeros. I haven't done any testing regarding this, so I don't know how many zeros in a row will break (...) (25 years ago, 6-Jun-99, to lugnet.robotics.rcx.legos, lugnet.robotics)

Message is in Reply To:
  RE: Lego Network Protocol questions
 
Sorry, I have been out of the loop for quite some time now on the protocol. Next time will someone smack me when I voluntarily take a compiler theory course on top of 3 other computer sciences courses. I had no life for over a month. I am currently (...) (25 years ago, 5-Jun-99, to lugnet.robotics.rcx.legos, lugnet.robotics)

15 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR