To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 1919
1918  |  1920
Subject: 
Re: frame RCX reply how
Newsgroups: 
lugnet.robotics.rcx
Date: 
Sat, 1 Feb 2003 01:06:27 GMT
Viewed: 
4470 times
  
I wish I could give you a direct answer, but I don't know. However, I
suspect (as I'm sure you do) that what you are looking for has already
been done. Below are three possible sources which you can adopt, co-opt,
or reverse-engineer to get where you are going. I'm a bit beyond my
expertise here, so someone correct me if I blunder. Forgive me if I tell
you something you already know.

1. LNP stands for Lego Network Protocol (although it is not a product
of, nor endorsed by, The Lego Group). It was created to allow IR
communication among multiple RCX units and IR Towers. I know you weren't
trying to implement LNP, but I thought pointing you to javastorms would
be helpful since a) there are bound to be similarities in the LNP frames
and the frames in the standard firmware and b) you were interested in
developing your code using javax.comm. In particular, the readMsg()
method in org.javastorms.lnp.IR.class validates an LNP frame.

2. BrickOS has recently implemented support for the Lego(tm) remote
control in kernel/remote.c, kernel/lnp.c and program.c. All IR
processing is first handled in lnp.c. If it looks like a remote control
button, the payload is extracted and passed to the designated handler
(whose "interface" is defined in remote.c). Normally, the handler will
be lrkey_handler() in program.c. Of course, the Lego remote is a
write-only device, but there is also some code in there (I don't know
how much) for handling standard firmware messages. The BrickOS source is
available at
http://sourceforge.net/project/showfiles.php?group_id=58151, and I am
referencing the latest release, 0.2.6.09.

3. Another (perhaps the best) place to look would be the BricxCC source
code at

    http://hometown.aol.com/johnbinder/bricxcc.htm

BricxCC is developed in Delphi, but the source is plain-text Pascal
files. BricxCC communicates extensively with the standard firmware (and
recently has learned to speak LNP as well).  In particular, it has
duplicated the functionality of Lego's spirit.ocx API in FakeSpirit.pas.
The actual work of parsing frames seems to be done in rcx_link.pas. Both
files are in the bricktools sub-directory of the Bricxcc source. With
this information, it should be possible to do a javax.comm
implementation of Lego's spirit.ocx if that is the route you want to take.


Bon chance!
-Brian

Pat LaVarre wrote:

Anybody know how to divide the bytes incoming
from the RCX IR replies into correct frames,
preferably using javax.comm on a Linux/Windows PC?


From: "Brian B. Alano" <throwaway@insightbb.com>
You might take apart javastorms:
http:/www.javastorms.org
They've implemented LNP using javax.comm.



Thanks for the link, but I meant only to be asking:

How do I make sense of RCX replies ...
... when the RCX is first powered and after I download Lego firmware.

Help?  Curiously, cluelessly, thankfully yours, Pat LaVarre







Message has 2 Replies:
  framing RCX LNP replies in Java
 
(...) Thanks I reached: src/org/javastorms/lnp/IR.java (...) I think I see ... readMsg accepts what it likes else dies after reading the first distasteful byte. readMsg likes either of xF0 or xF1, then a length byte, then that many bytes, then a (...) (21 years ago, 1-Feb-03, to lugnet.robotics.rcx.java)
  Re: frame RCX reply how
 
(...) Bingo! I reached the bricktools/ of the frame-free: (URL) bytes At a glance, I missed how bricxcc toggles x08 in the command op to let command ops be repeated, but I'd now guess the bricxcc algorithm for framing standard RCX replies is: 1) (...) (21 years ago, 1-Feb-03, to lugnet.robotics.rcx)

Message is in Reply To:
  Re: frame RCX reply how
 
(...) Thanks for the link, but I meant only to be asking: How do I make sense of RCX replies ... ... when the RCX is first powered and after I download Lego firmware. Help? Curiously, cluelessly, thankfully yours, Pat LaVarre P.S. Do we have no (...) (21 years ago, 31-Jan-03, to lugnet.robotics.rcx)

16 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