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 int
MAXREPLYLENGTH
static int
MAXSIZE
-
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 QsiMessage
getAck(QsiReply r)
boolean
getChecksum()
int
getOpCode()
(package private) int
match(java.lang.String s)
void
setElement(int n, int v)
Set a single Data Element at a particular index.void
setOpCode(int i)
(package private) int
skipEqual(int index)
(package private) int
skipWhiteSpace(int index)
boolean
strip()
java.lang.String
toString()
java.lang.String
toString(QsiTrafficController controller)
int
value()
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:AbstractMessage
Set a single Data Element at a particular index.- Specified by:
setElement
in interfaceMessage
- Overrides:
setElement
in 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)
-
-