Package jmri.jmrix.dcc4pc
Class Dcc4PcMessage
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRMessage
-
- jmri.jmrix.dcc4pc.Dcc4PcMessage
-
- All Implemented Interfaces:
Message
public class Dcc4PcMessage extends AbstractMRMessage
Encodes a message to the DCC4PC Interface.The
Dcc4PcReply
class handles the response from the command station.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
board
(package private) boolean
childBoard
(package private) static int
CHILDENABLEDINPUTS
(package private) static int
CHILDPOLL
(package private) static int
CHILDRESET
(package private) static int
DESC
(package private) static int
INFO
(package private) boolean
isResponse
static int
MAXSIZE
(package private) int
messageType
(package private) static int
RESPONSE
(package private) static int
SERIAL
-
Fields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Constructor Summary
Constructors Constructor Description Dcc4PcMessage(byte[] packet)
Creates a new Dcc4PcMessage containing a byte array to represent a packet to outputDcc4PcMessage(int i)
Dcc4PcMessage(java.lang.String s)
Dcc4PcMessage(Dcc4PcMessage m)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBoard()
static Dcc4PcMessage
getDescription()
static Dcc4PcMessage
getDescription(int address)
static Dcc4PcMessage
getEnabledInputs(int address)
static Dcc4PcMessage
getExitProgMode()
byte[]
getFormattedMessage()
Get formatted message for direct output to stream - this is the final format of the message as a byte arraystatic Dcc4PcMessage
getInfo()
static Dcc4PcMessage
getInfo(int address)
int
getMessageType()
static Dcc4PcMessage
getProgMode()
static Dcc4PcMessage
getResponse()
static Dcc4PcMessage
getSerialNumber()
static Dcc4PcMessage
getSerialNumber(int address)
boolean
isForChildBoard()
boolean
isGetResponse()
static Dcc4PcMessage
pollBoard(int address)
static Dcc4PcMessage
resetBoardData(int address)
void
setElement(int n, int v)
Set a single Data Element at a particular index.void
setForChildBoard(boolean boo)
java.lang.String
toString()
-
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setOpCode, setRetries, setTimeout
-
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
-
MAXSIZE
public static final int MAXSIZE
- See Also:
- Constant Field Values
-
childBoard
boolean childBoard
-
isResponse
boolean isResponse
-
board
int board
-
messageType
int messageType
-
INFO
static final int INFO
- See Also:
- Constant Field Values
-
DESC
static final int DESC
- See Also:
- Constant Field Values
-
SERIAL
static final int SERIAL
- See Also:
- Constant Field Values
-
CHILDENABLEDINPUTS
static final int CHILDENABLEDINPUTS
- See Also:
- Constant Field Values
-
CHILDRESET
static final int CHILDRESET
- See Also:
- Constant Field Values
-
CHILDPOLL
static final int CHILDPOLL
- See Also:
- Constant Field Values
-
RESPONSE
static final int RESPONSE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Dcc4PcMessage
public Dcc4PcMessage(int i)
-
Dcc4PcMessage
public Dcc4PcMessage(byte[] packet)
Creates a new Dcc4PcMessage containing a byte array to represent a packet to output- Parameters:
packet
- The contents of the packet
-
Dcc4PcMessage
public Dcc4PcMessage(java.lang.String s)
-
Dcc4PcMessage
public Dcc4PcMessage(Dcc4PcMessage m)
-
-
Method Detail
-
setForChildBoard
public void setForChildBoard(boolean boo)
-
isForChildBoard
public boolean isForChildBoard()
-
setElement
public void setElement(int n, int v)
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()
- Specified by:
toString
in interfaceMessage
- Overrides:
toString
in classAbstractMRMessage
-
getFormattedMessage
public byte[] getFormattedMessage()
Get formatted message for direct output to stream - this is the final format of the message as a byte array- Returns:
- the formatted message as a byte array
-
getProgMode
public static Dcc4PcMessage getProgMode()
-
getExitProgMode
public static Dcc4PcMessage getExitProgMode()
-
isGetResponse
public boolean isGetResponse()
-
getBoard
public int getBoard()
-
getMessageType
public int getMessageType()
-
getInfo
public static Dcc4PcMessage getInfo(int address)
-
getDescription
public static Dcc4PcMessage getDescription(int address)
-
getSerialNumber
public static Dcc4PcMessage getSerialNumber(int address)
-
resetBoardData
public static Dcc4PcMessage resetBoardData(int address)
-
pollBoard
public static Dcc4PcMessage pollBoard(int address)
-
getEnabledInputs
public static Dcc4PcMessage getEnabledInputs(int address)
-
getInfo
public static Dcc4PcMessage getInfo()
-
getResponse
public static Dcc4PcMessage getResponse()
-
getDescription
public static Dcc4PcMessage getDescription()
-
getSerialNumber
public static Dcc4PcMessage getSerialNumber()
-
-