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.

"header" refers to the full 11 or 29 bit header; which mode is separately set via the "extended" parameter

CBUS uses a 2-bit "Pri" field and 7-bit "ID" ("CAN ID") field, with separate accessors.

Author:
Andrew Crosland Copyright (C) 2008, Bob Jacobsen Copyright (C) 2008, 2009

Field Summary
 
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
 boolean equals(Object a)
          Note that a CanMessage and a CanReply can be tested for equality
 int getElement(int n)
           
 int getHeader()
           
 int getNumDataElements()
           
 boolean isExtended()
           
 boolean isRtr()
           
 void setData(int[] d)
           
 void setElement(int n, int v)
           
 void setExtended(boolean b)
           
 void setHeader(int h)
           
 void setNumDataElements(int n)
           
 void setRtr(boolean b)
           
protected  int skipPrefix(int index)
           
 
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, getOpCode, isBinary, isRetransmittableErrorMsg, isUnsolicited, match, maxSize, pollValue, setBinary, setOpCode, setUnsolicited, skipWhiteSpace, toString, value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CanReply

public CanReply()

CanReply

public CanReply(int i)

CanReply

public CanReply(int[] d)

CanReply

public CanReply(CanReply m)
Method Detail

equals

public boolean equals(Object a)
Note that a CanMessage and a CanReply can be tested for equality

Overrides:
equals in class Object

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)

getHeader

public int getHeader()

setHeader

public void setHeader(int h)

isExtended

public boolean isExtended()

setExtended

public void setExtended(boolean b)

isRtr

public boolean isRtr()

setRtr

public void setRtr(boolean b)


Copyright © 1997 - 2010 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: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads