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
-
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(String s)
Dcc4PcMessage(Dcc4PcMessage m)
-
Method Summary
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)
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
-
Field Details
-
MAXSIZE
- See Also:
- Constant Field Values
-
childBoard
boolean childBoard -
isResponse
boolean isResponse -
board
int board -
messageType
int messageType -
INFO
- See Also:
- Constant Field Values
-
DESC
- See Also:
- Constant Field Values
-
SERIAL
- See Also:
- Constant Field Values
-
CHILDENABLEDINPUTS
- See Also:
- Constant Field Values
-
CHILDRESET
- See Also:
- Constant Field Values
-
CHILDPOLL
- See Also:
- Constant Field Values
-
RESPONSE
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Dcc4PcMessage
-
Dcc4PcMessage
Creates a new Dcc4PcMessage containing a byte array to represent a packet to output- Parameters:
packet
- The contents of the packet
-
Dcc4PcMessage
-
Dcc4PcMessage
-
-
Method Details
-
setForChildBoard
-
isForChildBoard
-
setElement
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
- Specified by:
toString
in interfaceMessage
- Overrides:
toString
in classAbstractMRMessage
-
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
-
getExitProgMode
-
isGetResponse
-
getBoard
-
getMessageType
-
getInfo
-
getDescription
-
getSerialNumber
-
resetBoardData
-
pollBoard
-
getEnabledInputs
-
getInfo
-
getResponse
-
getDescription
-
getSerialNumber
-