Package jmri.jmrix.can.adapters.lawicell
Class Reply
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRReply
-
- jmri.jmrix.can.adapters.lawicell.Reply
-
- All Implemented Interfaces:
Message
public class Reply extends AbstractMRReply
Class for replies in a LAWICELL message/reply protocol.The Lawicell adapter protocol encodes messages as an ASCII string of up to 24 characters of the form: tiiildd...[CR] Tiiiiiiiildd...[CR] The t or T indicates a standard or extended CAN frame iiiiiiii is the header as hex digits l is the number of bytes of data dd are the (up to) 8 data bytes
RTR Extended frames start with an R, RTR standard frames with r.
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZE
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CanReply
createReply()
int
getByte(int b)
Get a hex data byte from the messageint
getHeader()
Get the CAN header as an intint
getNumBytes()
Get the number of data bytesboolean
isExtended()
boolean
isRtrSet()
void
setData(int[] d)
protected int
skipPrefix(int index)
-
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, getOpCode, isBinary, isRetransmittableErrorMsg, isUnsolicited, match, maxSize, pollValue, setBinary, setElement, setOpCode, setUnsolicited, skipWhiteSpace, toString, value
-
Methods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.Message
toMonitorString
-
-
-
-
Method Detail
-
createReply
public CanReply createReply()
-
skipPrefix
protected int skipPrefix(int index)
- Specified by:
skipPrefix
in classAbstractMRReply
-
setData
public void setData(int[] d)
-
isExtended
public boolean isExtended()
-
isRtrSet
public boolean isRtrSet()
-
getHeader
public int getHeader()
Get the CAN header as an int- Returns:
- int the CAN ID
-
getNumBytes
public int getNumBytes()
Get the number of data bytes- Returns:
- int the number of bytes
-
getByte
public int getByte(int b)
Get a hex data byte from the messageData bytes are encoded as two ASCII hex digits. The starting position is byte 10 or byte 5, depending on whether this is an extended or standard message
- Parameters:
b
- The byte offset (0 - 7)- Returns:
- The value
-
-