Package jmri.jmrix.dcc4pc
Class Dcc4PcMessage
java.lang.Object
jmri.jmrix.AbstractMessage
jmri.jmrix.AbstractMRMessage
jmri.jmrix.dcc4pc.Dcc4PcMessage
- All Implemented Interfaces:
Message
Encodes a message to the DCC4PC Interface.
The Dcc4PcReply class handles the response from the command station.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) static final int(package private) static final int(package private) boolean(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) booleanstatic final int(package private) int(package private) boolean(package private) static final int(package private) static final intstatic final intSPEED code for 62.5 kbps (Omnibus spec section 6).Fields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT, sourceLetterFields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars -
Constructor Summary
ConstructorsConstructorDescriptionDcc4PcMessage(byte[] packet) Creates a new Dcc4PcMessage containing a byte array to represent a packet to outputDcc4PcMessage(int i) -
Method Summary
Modifier and TypeMethodDescriptionstatic Dcc4PcMessageBUS Reset Speeds (0x0D, BUS 1.1): every board and the interface go back to 8 kbps.static Dcc4PcMessagebusSetSpeed(int address, int speed) BUS Set Speed (0x07): the speed the interface uses to talk to one board.intgetBoard()static Dcc4PcMessagestatic Dcc4PcMessagegetDescription(int address) static Dcc4PcMessagegetEnabledInputs(int address) static Dcc4PcMessagebyte[]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) intstatic Dcc4PcMessagestatic Dcc4PcMessagestatic Dcc4PcMessagestatic Dcc4PcMessagegetSerialNumber(int address) booleanbooleanbooleanstatic Dcc4PcMessagepollBoard(int address) booleanIs a reply expected to this message?static Dcc4PcMessageresetBoardData(int address) static Dcc4PcMessageselectRawEncoding(int address) Select the Raw RailCom encoding (encoding 0), the only one decoded.static Dcc4PcMessagesetBoardSpeed(int address, int speed) Mandatory Set Speed (0x04) for a board: it switches to the new bus speed once this transaction is complete.voidsetElement(int n, int v) Set a single Data Element at a particular index.voidsetForChildBoard(boolean boo) toString()Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getSourceLetter, getTimeout, isBinary, setBinary, setNeededMode, setOpCode, setRetries, setTimeoutMethods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrix.Message
toMonitorString
-
Field Details
-
MAXSIZE
- See Also:
-
childBoard
boolean childBoard -
isResponse
boolean isResponse -
board
int board -
messageType
int messageType -
INFO
- See Also:
-
DESC
- See Also:
-
SERIAL
- See Also:
-
CHILDSELECTENCODING
- See Also:
-
CHILDENABLEDINPUTS
- See Also:
-
CHILDRESET
- See Also:
-
CHILDPOLL
- See Also:
-
RESPONSE
- See Also:
-
CHILDSETSPEED
- See Also:
-
BUSSETSPEED
- See Also:
-
BUSRESETSPEEDS
- See Also:
-
SPEED_62K5
SPEED code for 62.5 kbps (Omnibus spec section 6).- See Also:
-
noDataReply
boolean noDataReply
-
-
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:
setElementin interfaceMessage- Overrides:
setElementin classAbstractMessage- Parameters:
n- index of element.v- value of element.
-
toString
- Specified by:
toStringin interfaceMessage- Overrides:
toStringin 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
-
setBoardSpeed
Mandatory Set Speed (0x04) for a board: it switches to the new bus speed once this transaction is complete. The interface must then be told withbusSetSpeed(int, int).- Parameters:
address- board addressspeed- SPEED code, 0 for 8 kbps- Returns:
- the message
-
busSetSpeed
BUS Set Speed (0x07): the speed the interface uses to talk to one board.- Parameters:
address- board addressspeed- SPEED code, 0 for 8 kbps- Returns:
- the message
-
isNoDataReply
- Returns:
- true if the interface answers this message with no data, only its DSR handshake
-
replyExpected
Description copied from class:AbstractMRMessageIs a reply expected to this message?By default, a reply is expected to every message; either a reply or a timeout is needed before the next message can be sent.
If this returns false, the transmit queue will immediately go on to transmit the next message (if any).
- Overrides:
replyExpectedin classAbstractMRMessage- Returns:
- true by default in Abstract MR message.
-
busResetSpeeds
BUS Reset Speeds (0x0D, BUS 1.1): every board and the interface go back to 8 kbps.- Returns:
- the message
-
selectRawEncoding
Select the Raw RailCom encoding (encoding 0), the only one decoded.- Parameters:
address- board address- Returns:
- the message
-
resetBoardData
-
pollBoard
-
getEnabledInputs
-
getInfo
-
getResponse
-
getDescription
-
getSerialNumber
-