Package jmri.jmrix.qsi
Class QsiReply
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.qsi.QsiReply
-
- All Implemented Interfaces:
Message
public class QsiReply extends AbstractMessage
Carries the reply to an QsiMessage.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intMAXREPLYLENGTHstatic intMAXSIZE-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QsiMessagegetAck(QsiReply r)booleangetChecksum()intgetOpCode()(package private) intmatch(java.lang.String s)voidsetElement(int n, int v)Set a single Data Element at a particular index.voidsetOpCode(int i)(package private) intskipEqual(int index)(package private) intskipWhiteSpace(int index)booleanstrip()java.lang.StringtoString()java.lang.StringtoString(QsiTrafficController controller)intvalue()Extracts Read-CV returned value from a message.-
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
-
-
-
-
Field Detail
-
MAXREPLYLENGTH
static final int MAXREPLYLENGTH
- See Also:
- Constant Field Values
-
MAXSIZE
public static final int MAXSIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setOpCode
public void setOpCode(int i)
-
getOpCode
public int getOpCode()
-
setElement
public void setElement(int n, int v)
Description copied from class:AbstractMessageSet a single Data Element at a particular index.- Specified by:
setElementin interfaceMessage- Overrides:
setElementin classAbstractMessage- Parameters:
n- index of element.v- value of element.
-
getAck
public static QsiMessage getAck(QsiReply r)
-
strip
public boolean strip()
-
getChecksum
public boolean getChecksum()
-
toString
public java.lang.String toString(QsiTrafficController controller)
-
value
public int value()
Extracts Read-CV returned value from a message.QSI is assumed to not be echoing commands. A reply to a command may include the prompt that was printed after the previous command Reply to a CV read is of the form " = hvv" where vv is the CV value in hex.
- Returns:
- the value of the read CV or -1 if the reply cannot be parsed.
-
match
int match(java.lang.String s)
-
skipWhiteSpace
int skipWhiteSpace(int index)
-
skipEqual
int skipEqual(int index)
-
-