|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractMessage
jmri.jmrix.AbstractMRMessage
jmri.jmrix.lenz.XNetMessage
public class XNetMessage
Represents a single command or response on the XpressNet.
Content is represented with ints to avoid the problems with sign-extension that bytes have, and because a Java char is actually a variable number of bytes in Unicode.
| Field Summary |
|---|
| Fields inherited from class jmri.jmrix.AbstractMRMessage |
|---|
LONG_TIMEOUT, SHORT_TIMEOUT |
| Fields inherited from class jmri.jmrix.AbstractMessage |
|---|
_dataChars, _nDataChars |
| Constructor Summary | |
|---|---|
XNetMessage(int len)
Create a new object, representing a specific-length message. |
|
XNetMessage(String s)
Create an XNetMessage from a String containing bytes. |
|
XNetMessage(XNetMessage message)
Create a new object, that is a copy of an existing message. |
|
XNetMessage(XNetReply message)
Create an XNetMessage from an XNetReply. |
|
| Method Summary | |
|---|---|
boolean |
checkParity()
check whether the message has a valid parity |
static XNetMessage |
getAddLocoToConsistMsg(int consist,
int address,
boolean isNormalDir)
|
static XNetMessage |
getAddressedEmergencyStop(int address)
|
static XNetMessage |
getBitVerifyOpsModeCVMsg(int AH,
int AL,
int cv,
int bit,
boolean value)
|
static XNetMessage |
getBitWriteOpsModeCVMsg(int AH,
int AL,
int cv,
int bit,
boolean value)
|
static XNetMessage |
getBuildDoubleHeaderMsg(int address1,
int address2)
|
static XNetMessage |
getCSAutoStartMessage(boolean autoMode)
Generate the message to set the Command Station to Auto or Manual restart mode. |
static XNetMessage |
getCSStatusRequestMessage()
Generate the message to request the Command Station Status |
static XNetMessage |
getCSVersionRequestMessage()
Generate the message to request the Command Station Hardware/Software Version |
static XNetMessage |
getDBSearchMsgConsistAddress(int address,
boolean searchForward)
|
static XNetMessage |
getDBSearchMsgNextMULoco(int consist,
int address,
boolean searchForward)
|
static XNetMessage |
getDeleteAddressOnStackMsg(int address)
|
static XNetMessage |
getDisolveDoubleHeaderMsg(int address)
|
Integer |
getElementBCD(int n)
Get an integer representation of a BCD value |
static XNetMessage |
getEmergencyOffMsg()
|
static XNetMessage |
getExitProgModeMsg()
|
static XNetMessage |
getFeedbackRequestMsg(int pNumber,
boolean pLowerNibble)
Generate a message to recieve the feedback information for an upper or lower nibble of the feedback address in question |
static XNetMessage |
getFunctionGroup1OpsMsg(int address,
boolean f0,
boolean f1,
boolean f2,
boolean f3,
boolean f4)
|
static XNetMessage |
getFunctionGroup1SetMomMsg(int address,
boolean f0,
boolean f1,
boolean f2,
boolean f3,
boolean f4)
|
static XNetMessage |
getFunctionGroup2OpsMsg(int address,
boolean f5,
boolean f6,
boolean f7,
boolean f8)
|
static XNetMessage |
getFunctionGroup2SetMomMsg(int address,
boolean f5,
boolean f6,
boolean f7,
boolean f8)
|
static XNetMessage |
getFunctionGroup3OpsMsg(int address,
boolean f9,
boolean f10,
boolean f11,
boolean f12)
|
static XNetMessage |
getFunctionGroup3SetMomMsg(int address,
boolean f9,
boolean f10,
boolean f11,
boolean f12)
|
static XNetMessage |
getFunctionGroup4OpsMsg(int address,
boolean f13,
boolean f14,
boolean f15,
boolean f16,
boolean f17,
boolean f18,
boolean f19,
boolean f20)
|
static XNetMessage |
getFunctionGroup4SetMomMsg(int address,
boolean f13,
boolean f14,
boolean f15,
boolean f16,
boolean f17,
boolean f18,
boolean f19,
boolean f20)
|
static XNetMessage |
getFunctionGroup5OpsMsg(int address,
boolean f21,
boolean f22,
boolean f23,
boolean f24,
boolean f25,
boolean f26,
boolean f27,
boolean f28)
|
static XNetMessage |
getFunctionGroup5SetMomMsg(int address,
boolean f21,
boolean f22,
boolean f23,
boolean f24,
boolean f25,
boolean f26,
boolean f27,
boolean f28)
|
static XNetMessage |
getLIAddressRequestMsg(int address)
Generate the message to set or request the Computer Interface Address |
static XNetMessage |
getLISpeedRequestMsg(int speed)
Generate the message to set or request the Computer Interface speed |
static XNetMessage |
getLIVersionRequestMessage()
Generate the message to request the Computer Interface Hardware/Software Version |
static XNetMessage |
getLocomotiveFunctionHighMomStatusMsg(int address)
|
static XNetMessage |
getLocomotiveFunctionHighOnStatusMsg(int address)
|
static XNetMessage |
getLocomotiveFunctionStatusMsg(int address)
|
static XNetMessage |
getLocomotiveInfoRequestMsg(int address)
|
static XNetMessage |
getNextAddressOnStackMsg(int address,
boolean searchForward)
|
static XNetMessage |
getNMRAXNetMsg(byte[] packet)
|
int |
getOpCode()
|
String |
getOpCodeHex()
Get a String representation of the op code in hex |
static XNetMessage |
getReadDirectCVMsg(int cv)
|
static XNetMessage |
getReadPagedCVMsg(int cv)
|
static XNetMessage |
getReadRegisterMsg(int reg)
|
static XNetMessage |
getRemoveLocoFromConsistMsg(int consist,
int address)
|
static XNetMessage |
getResumeOperationsMsg()
|
static XNetMessage |
getServiceModeResultsMsg()
|
static XNetMessage |
getSpeedAndDirectionMsg(int address,
int speedStepMode,
float speed,
boolean isForward)
|
static XNetMessage |
getTurnoutCommandMsg(int pNumber,
boolean pClose,
boolean pThrow,
boolean pOn)
Generate a message to change turnout state |
static XNetMessage |
getVerifyOpsModeCVMsg(int AH,
int AL,
int cv,
int val)
|
static XNetMessage |
getWriteDirectCVMsg(int cv,
int val)
|
static XNetMessage |
getWriteOpsModeCVMsg(int AH,
int AL,
int cv,
int val)
|
static XNetMessage |
getWritePagedCVMsg(int cv,
int val)
|
static XNetMessage |
getWriteRegisterMsg(int reg,
int val)
|
int |
length()
return the message length |
void |
setOpCode(int i)
|
void |
setParity()
|
static void |
setXNetMessageRetries(int t)
changing the default number of retries for an XPressNet message |
static void |
setXNetMessageTimeout(int t)
changing the default timeout for an XPressNet message |
| Methods inherited from class jmri.jmrix.AbstractMRMessage |
|---|
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setRetries, setTimeout, toString |
| Methods inherited from class jmri.jmrix.AbstractMessage |
|---|
getElement, getNumDataElements, setElement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XNetMessage(int len)
len - Total bytes in message, including opcode and error-detection byte.public XNetMessage(XNetMessage message)
message - existing message.public XNetMessage(XNetReply message)
public XNetMessage(String s)
| Method Detail |
|---|
public void setOpCode(int i)
setOpCode in class AbstractMRMessagepublic int getOpCode()
getOpCode in class AbstractMRMessagepublic String getOpCodeHex()
getOpCodeHex in class AbstractMRMessagepublic boolean checkParity()
public void setParity()
public Integer getElementBCD(int n)
public int length()
public static void setXNetMessageRetries(int t)
t - number of retries to attempt.public static void setXNetMessageTimeout(int t)
t - Timeout in millisecondspublic static XNetMessage getNMRAXNetMsg(byte[] packet)
public static XNetMessage getTurnoutCommandMsg(int pNumber,
boolean pClose,
boolean pThrow,
boolean pOn)
public static XNetMessage getFeedbackRequestMsg(int pNumber,
boolean pLowerNibble)
public static XNetMessage getServiceModeResultsMsg()
public static XNetMessage getExitProgModeMsg()
public static XNetMessage getReadPagedCVMsg(int cv)
public static XNetMessage getReadDirectCVMsg(int cv)
public static XNetMessage getWritePagedCVMsg(int cv,
int val)
public static XNetMessage getWriteDirectCVMsg(int cv,
int val)
public static XNetMessage getReadRegisterMsg(int reg)
public static XNetMessage getWriteRegisterMsg(int reg,
int val)
public static XNetMessage getWriteOpsModeCVMsg(int AH,
int AL,
int cv,
int val)
public static XNetMessage getVerifyOpsModeCVMsg(int AH,
int AL,
int cv,
int val)
public static XNetMessage getBitWriteOpsModeCVMsg(int AH,
int AL,
int cv,
int bit,
boolean value)
public static XNetMessage getBitVerifyOpsModeCVMsg(int AH,
int AL,
int cv,
int bit,
boolean value)
public static XNetMessage getBuildDoubleHeaderMsg(int address1,
int address2)
public static XNetMessage getDisolveDoubleHeaderMsg(int address)
public static XNetMessage getAddLocoToConsistMsg(int consist,
int address,
boolean isNormalDir)
public static XNetMessage getRemoveLocoFromConsistMsg(int consist,
int address)
public static XNetMessage getNextAddressOnStackMsg(int address,
boolean searchForward)
public static XNetMessage getDBSearchMsgConsistAddress(int address,
boolean searchForward)
public static XNetMessage getDBSearchMsgNextMULoco(int consist,
int address,
boolean searchForward)
public static XNetMessage getDeleteAddressOnStackMsg(int address)
public static XNetMessage getLocomotiveInfoRequestMsg(int address)
public static XNetMessage getLocomotiveFunctionStatusMsg(int address)
public static XNetMessage getLocomotiveFunctionHighOnStatusMsg(int address)
public static XNetMessage getLocomotiveFunctionHighMomStatusMsg(int address)
public static XNetMessage getAddressedEmergencyStop(int address)
public static XNetMessage getSpeedAndDirectionMsg(int address,
int speedStepMode,
float speed,
boolean isForward)
public static XNetMessage getFunctionGroup1OpsMsg(int address,
boolean f0,
boolean f1,
boolean f2,
boolean f3,
boolean f4)
public static XNetMessage getFunctionGroup1SetMomMsg(int address,
boolean f0,
boolean f1,
boolean f2,
boolean f3,
boolean f4)
public static XNetMessage getFunctionGroup2OpsMsg(int address,
boolean f5,
boolean f6,
boolean f7,
boolean f8)
public static XNetMessage getFunctionGroup2SetMomMsg(int address,
boolean f5,
boolean f6,
boolean f7,
boolean f8)
public static XNetMessage getFunctionGroup3OpsMsg(int address,
boolean f9,
boolean f10,
boolean f11,
boolean f12)
public static XNetMessage getFunctionGroup3SetMomMsg(int address,
boolean f9,
boolean f10,
boolean f11,
boolean f12)
public static XNetMessage getFunctionGroup4OpsMsg(int address,
boolean f13,
boolean f14,
boolean f15,
boolean f16,
boolean f17,
boolean f18,
boolean f19,
boolean f20)
public static XNetMessage getFunctionGroup4SetMomMsg(int address,
boolean f13,
boolean f14,
boolean f15,
boolean f16,
boolean f17,
boolean f18,
boolean f19,
boolean f20)
public static XNetMessage getFunctionGroup5OpsMsg(int address,
boolean f21,
boolean f22,
boolean f23,
boolean f24,
boolean f25,
boolean f26,
boolean f27,
boolean f28)
public static XNetMessage getFunctionGroup5SetMomMsg(int address,
boolean f21,
boolean f22,
boolean f23,
boolean f24,
boolean f25,
boolean f26,
boolean f27,
boolean f28)
public static XNetMessage getResumeOperationsMsg()
public static XNetMessage getEmergencyOffMsg()
public static XNetMessage getCSVersionRequestMessage()
public static XNetMessage getCSStatusRequestMessage()
public static XNetMessage getCSAutoStartMessage(boolean autoMode)
public static XNetMessage getLIVersionRequestMessage()
public static XNetMessage getLIAddressRequestMsg(int address)
address - Interface address (0-31). Send invalid address
to request the address (32-255).public static XNetMessage getLISpeedRequestMsg(int speed)
speed - 1 is 19,200bps, 2 is 38,400bps, 3 is 57,600bps, 4 is
115,200bps. Send invalid speed to request the current setting.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||