Package jmri.jmrix.grapevine
Class SerialReply
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRReply
-
- jmri.jmrix.grapevine.SerialReply
-
- All Implemented Interfaces:
Message
public class SerialReply extends AbstractMRReply
Contains the data payload of a serial reply packet. Note that it's _only_ the payload.
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZE
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Constructor Summary
Constructors Constructor Description SerialReply()
Create a new SerialReply instance.SerialReply(java.lang.String s)
Create a new SerialReply instance from a string.SerialReply(SerialReply l)
Copy a Reply to a new SerialReply instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
format()
Format the reply as human-readable text.int
getAddr()
Is reply to poll message.int
getBank()
boolean
isError()
boolean
isFromNewSerialSensor()
boolean
isFromOldSerialSensor()
boolean
isFromParallelSensor()
boolean
isUnsolicited()
Get flag for Unsolicited.void
setNumDataElements(int len)
protected int
skipPrefix(int index)
-
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, getOpCode, isBinary, isRetransmittableErrorMsg, 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
-
-
-
-
Constructor Detail
-
SerialReply
public SerialReply()
Create a new SerialReply instance.
-
SerialReply
public SerialReply(SerialReply l)
Copy a Reply to a new SerialReply instance.- Parameters:
l
- the reply to copy
-
SerialReply
public SerialReply(java.lang.String s)
Create a new SerialReply instance from a string.- Parameters:
s
- String to use as reply content
-
-
Method Detail
-
getAddr
public int getAddr()
Is reply to poll message.- Returns:
- true if reply to a poll message, else false.
-
isUnsolicited
public boolean isUnsolicited()
Description copied from class:AbstractMRReply
Get flag for Unsolicited.- Overrides:
isUnsolicited
in classAbstractMRReply
- Returns:
- true if Unsolicited, else false.
-
skipPrefix
protected int skipPrefix(int index)
- Specified by:
skipPrefix
in classAbstractMRReply
-
getBank
public int getBank()
-
isError
public boolean isError()
-
isFromParallelSensor
public boolean isFromParallelSensor()
-
isFromOldSerialSensor
public boolean isFromOldSerialSensor()
-
isFromNewSerialSensor
public boolean isFromNewSerialSensor()
-
setNumDataElements
public void setNumDataElements(int len)
-
format
public java.lang.String format()
Format the reply as human-readable text.Since Grapevine doesn't distinguish between message and reply, this uses the Message method.
- Returns:
- human readable text of reply.
-
-