|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractMessage
jmri.jmrix.AbstractMRReply
jmri.jmrix.lenz.XNetReply
public class XNetReply
Represents a single response from the XpressNet.
| Field Summary |
|---|
| Fields inherited from class jmri.jmrix.AbstractMRReply |
|---|
DEFAULTMAXSIZE |
| Fields inherited from class jmri.jmrix.AbstractMessage |
|---|
_dataChars, _nDataChars |
| Constructor Summary | |
|---|---|
XNetReply()
|
|
XNetReply(String message)
Create a reply from a string of hex characters. |
|
XNetReply(XNetMessage message)
Create a reply from an XNetMessage. |
|
XNetReply(XNetReply reply)
|
|
| Method Summary | |
|---|---|
boolean |
checkParity()
check whether the message has a valid parity |
Integer |
getElementBCD(int n)
Get an integer representation of a BCD value |
int |
getFeedbackEncoderMsgAddr()
If this is a feedback response message for a feedback encoder, return the address. |
int |
getFeedbackEncoderMsgAddr(int startByte)
If this is a feedback broadcast message and the specified startByte is the address byte of an address byte/data byte pair for a feedback encoder, return the address. |
int |
getFeedbackMessageType()
Extract the feedback message type from a feedback message this is the middle two bits of the upper byte of the second data byte. |
int |
getFeedbackMessageType(int startByte)
Extract the feedback message type from the data byte of associated with the specified address byte specified by startByte. |
String |
getOpCodeHex()
|
int |
getThrottleMsgAddr()
If this is a throttle-type message, return address. |
int |
getTurnoutMsgAddr()
If this is a feedback response message for a turnout, return the address. |
int |
getTurnoutMsgAddr(int startByte)
If this is a feedback broadcast message and the specified startbyte is the address byte of an addres byte data byte pair for a turnout, return the address. |
int |
getTurnoutStatus(int turnout)
Parse the feedback message for a turnout, and return the status for the even or odd half of the nibble (upper or lower part) |
int |
getTurnoutStatus(int startByte,
int turnout)
Parse the specified address byte/data byte pair in a feedback broadcast message and see if it is for a turnout. |
boolean |
isCommErrorMessage()
|
boolean |
isConsistMessage()
Is this a consist message? |
boolean |
isCSBusyMessage()
|
boolean |
isCSTransferError()
|
boolean |
isFeedbackBroadcastMessage()
Is this a feedback broadcast message? |
boolean |
isFeedbackMessage()
Is this a feedback response message? |
boolean |
isOkMessage()
|
boolean |
isRetransmittableErrorMsg()
|
boolean |
isThrottleMessage()
Is this a throttle message? |
boolean |
isThrottleTakenOverMessage()
Does this message indicate the locomotive has been taken over by another device? |
boolean |
isUnsolicited()
|
void |
resetUnsolicited()
|
void |
setParity()
|
protected int |
skipPrefix(int index)
|
| Methods inherited from class jmri.jmrix.AbstractMRReply |
|---|
flush, getOpCode, isBinary, match, maxSize, pollValue, setBinary, setElement, setOpCode, setUnsolicited, skipWhiteSpace, toString, value |
| Methods inherited from class jmri.jmrix.AbstractMessage |
|---|
getElement, getNumDataElements |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XNetReply()
public XNetReply(XNetReply reply)
public XNetReply(XNetMessage message)
public XNetReply(String message)
| Method Detail |
|---|
public String getOpCodeHex()
public boolean checkParity()
public void setParity()
public Integer getElementBCD(int n)
n - byte in message to convert
protected int skipPrefix(int index)
skipPrefix in class AbstractMRReplypublic int getTurnoutMsgAddr()
If this is a feedback response message for a turnout, return the address. Otherwise return -1.
public int getTurnoutMsgAddr(int startByte)
If this is a feedback broadcast message and the specified startbyte is the address byte of an addres byte data byte pair for a turnout, return the address. Otherwise return -1.
startByte - address byte of the address byte/data byte pair.
public int getTurnoutStatus(int turnout)
Parse the feedback message for a turnout, and return the status for the even or odd half of the nibble (upper or lower part)
turnout - Turnout
public int getTurnoutStatus(int startByte,
int turnout)
Parse the specified address byte/data byte pair in a feedback broadcast message and see if it is for a turnout. If it is, return the status for the even or odd half of the nibble (upper or lower part)
startByte - address byte of the address byte/data byte pair.turnout - Turnoutpublic int getFeedbackEncoderMsgAddr()
public int getFeedbackEncoderMsgAddr(int startByte)
If this is a feedback broadcast message and the specified startByte is the address byte of an address byte/data byte pair for a feedback encoder, return the address. Otherwise return -1.
startByte - address byte of the address byte data byte pair.
public boolean isFeedbackMessage()
public boolean isFeedbackBroadcastMessage()
public int getFeedbackMessageType()
Extract the feedback message type from a feedback message this is the middle two bits of the upper byte of the second data byte.
public int getFeedbackMessageType(int startByte)
Extract the feedback message type from the data byte of associated with the specified address byte specified by startByte.
The return value is the middle two bits of the upper byte of the data byte of an address byte/data byte pair.
startByte - The address byte for this addres byte data byte
pair.
public int getThrottleMsgAddr()
public boolean isThrottleMessage()
public boolean isThrottleTakenOverMessage()
public boolean isConsistMessage()
public boolean isOkMessage()
public boolean isCSBusyMessage()
public boolean isCSTransferError()
public boolean isCommErrorMessage()
public boolean isRetransmittableErrorMsg()
isRetransmittableErrorMsg in class AbstractMRReplypublic boolean isUnsolicited()
isUnsolicited in class AbstractMRReplypublic final void resetUnsolicited()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||