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
Dcc4PcReplyclass handles the response from the command station.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intboard(package private) booleanchildBoard(package private) static intCHILDENABLEDINPUTS(package private) static intCHILDPOLL(package private) static intCHILDRESET(package private) static intDESC(package private) static intINFO(package private) booleanisResponsestatic intMAXSIZE(package private) intmessageType(package private) static intRESPONSE(package private) static intSERIAL-
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 intgetBoard()static Dcc4PcMessagegetDescription()static Dcc4PcMessagegetDescription(int address)static Dcc4PcMessagegetEnabledInputs(int address)static Dcc4PcMessagegetExitProgMode()byte[]getFormattedMessage()Get formatted message for direct output to stream - this is the final format of the message as a byte arraystatic Dcc4PcMessagegetInfo()static Dcc4PcMessagegetInfo(int address)intgetMessageType()static Dcc4PcMessagegetProgMode()static Dcc4PcMessagegetResponse()static Dcc4PcMessagegetSerialNumber()static Dcc4PcMessagegetSerialNumber(int address)booleanisForChildBoard()booleanisGetResponse()static Dcc4PcMessagepollBoard(int address)static Dcc4PcMessageresetBoardData(int address)voidsetElement(int n, int v)Set a single Data Element at a particular index.voidsetForChildBoard(boolean boo)java.lang.StringtoString()-
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:
setElementin interfaceMessage- Overrides:
setElementin classAbstractMessage- Parameters:
n- index of element.v- value of element.
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfaceMessage- Overrides:
toStringin 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()
-
-