jmri.jmrix.can
Class CanReply

java.lang.Object
  extended by jmri.jmrix.AbstractMessage
      extended by jmri.jmrix.AbstractMRReply
          extended by jmri.jmrix.can.CanReply
All Implemented Interfaces:
Message

public class CanReply
extends AbstractMRReply

Base class for replies in a CANbus based message/reply protocol.

It is expected that any CAN based system will be based upon basic CANbus concepts such as ID (standard or extended), Normal and RTR frames and a data field.

The _dataChars[] and _nDataChars members refer to the data field, not the entire message.

Author:
Andrew Crosland Copyright (C) 2008

Field Summary
protected  int _id
           
protected  boolean _isExtended
           
protected  boolean _isRtr
           
protected  int _pri
           
 
Fields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZE
 
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
 
Constructor Summary
CanReply()
           
CanReply(CanReply m)
           
CanReply(int i)
           
CanReply(int[] d)
           
 
Method Summary
 int getElement(int n)
           
 int getId()
           
 int getNumDataElements()
           
 int getPri()
           
 boolean isExtended()
           
 boolean isRtr()
           
 void setData(int[] d)
           
 void setElement(int n, int v)
           
 void setExtended(boolean b)
           
 void setId(int id)
           
 void setId(int id, boolean b)
           
 void setNumDataElements(int n)
           
 void setPri(int pri)
           
 void setRtr(boolean b)
           
protected  int skipPrefix(int index)
           
 String toAddress()
          The following is really CBUS.
 
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, getOpCode, isBinary, isUnsolicited, match, maxSize, pollValue, setBinary, setOpCode, setUnsolicited, skipWhiteSpace, toString, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_pri

protected int _pri

_id

protected int _id

_isExtended

protected boolean _isExtended

_isRtr

protected boolean _isRtr
Constructor Detail

CanReply

public CanReply()

CanReply

public CanReply(int i)

CanReply

public CanReply(int[] d)

CanReply

public CanReply(CanReply m)
Method Detail

toAddress

public String toAddress()
The following is really CBUS. It should be refactored to a separate CBUS place, and also combined with the CanMessage version


skipPrefix

protected int skipPrefix(int index)
Specified by:
skipPrefix in class AbstractMRReply

getNumDataElements

public int getNumDataElements()
Specified by:
getNumDataElements in interface Message
Overrides:
getNumDataElements in class AbstractMessage

setNumDataElements

public void setNumDataElements(int n)

getElement

public int getElement(int n)
Specified by:
getElement in interface Message
Overrides:
getElement in class AbstractMessage

setElement

public void setElement(int n,
                       int v)
Specified by:
setElement in interface Message
Overrides:
setElement in class AbstractMRReply

setData

public void setData(int[] d)

getId

public int getId()

setId

public void setId(int id)

setId

public void setId(int id,
                  boolean b)

getPri

public int getPri()

setPri

public void setPri(int pri)

isExtended

public boolean isExtended()

setExtended

public void setExtended(boolean b)

isRtr

public boolean isRtr()

setRtr

public void setRtr(boolean b)


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo