Package jmri.jmrix.direct
Class Message
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRMessage
-
- jmri.jmrix.direct.Message
-
- All Implemented Interfaces:
Message
public class Message extends AbstractMRMessage
Encodes a message for Direct DCC.
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAddr()
int
getElement(int n)
Get a particular element in a Message.static Message
getEnableMain()
static Message
getExitProgMode()
static Message
getKillMain()
int
getNumDataElements()
Get the number of data elements in a Message.int
getOpCode()
java.lang.String
getOpCodeHex()
static Message
getProgMode()
static Message
getReadCV(int cv, ProgrammingMode mode)
static Message
getReadRegister(int reg)
static Message
getWriteCV(int cv, int val, ProgrammingMode mode)
static Message
getWriteRegister(int reg, int val)
boolean
isEnableMain()
boolean
isKillMain()
void
setElement(int n, int v)
Set a single Data Element at a particular index.void
setOpCode(int i)
java.lang.String
toString()
-
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setRetries, setTimeout
-
Methods inherited from class jmri.jmrix.AbstractMessage
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.Message
toMonitorString
-
-
-
-
Method Detail
-
setOpCode
public void setOpCode(int i)
- Overrides:
setOpCode
in classAbstractMRMessage
-
getOpCode
public int getOpCode()
- Overrides:
getOpCode
in classAbstractMRMessage
-
getOpCodeHex
public java.lang.String getOpCodeHex()
- Overrides:
getOpCodeHex
in classAbstractMRMessage
-
getNumDataElements
public int getNumDataElements()
Description copied from class:AbstractMessage
Get the number of data elements in a Message.- Specified by:
getNumDataElements
in interfaceMessage
- Overrides:
getNumDataElements
in classAbstractMessage
- Returns:
- number elements.
-
getElement
public int getElement(int n)
Description copied from class:AbstractMessage
Get a particular element in a Message.- Specified by:
getElement
in interfaceMessage
- Overrides:
getElement
in classAbstractMessage
- Parameters:
n
- Element Index.- Returns:
- single element of message.
-
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.
-
toString
public java.lang.String toString()
Description copied from interface:Message
- Specified by:
toString
in interfaceMessage
- Overrides:
toString
in classAbstractMRMessage
-
isKillMain
public boolean isKillMain()
-
isEnableMain
public boolean isEnableMain()
-
getEnableMain
public static Message getEnableMain()
-
getKillMain
public static Message getKillMain()
-
getProgMode
public static Message getProgMode()
-
getExitProgMode
public static Message getExitProgMode()
-
getReadCV
public static Message getReadCV(int cv, ProgrammingMode mode)
-
getWriteCV
public static Message getWriteCV(int cv, int val, ProgrammingMode mode)
-
getReadRegister
public static Message getReadRegister(int reg)
-
getWriteRegister
public static Message getWriteRegister(int reg, int val)
-
getAddr
public int getAddr()
-
-