Package jmri.jmrix.mrc
Class MrcMessage
java.lang.Object
jmri.jmrix.mrc.MrcMessage
Encodes and decoders messages to an MRC command station.
Some of the message formats used in this class are Copyright MRC, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact MRC Inc for separate permission.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[](package private) booleanprotected static final int(package private) int(package private) boolean(package private) int(package private) int(package private) int(package private) MrcTrafficListener(package private) int -
Constructor Summary
ConstructorsConstructorDescriptionMrcMessage(byte[] contents) MrcMessage(int len) MrcMessage(int[] contents) MrcMessage(MrcMessage original) -
Method Summary
Modifier and TypeMethodDescriptionintint(package private) byte[](package private) static intgetCheckSum(int addressHi, int addressLo, int data1, int data2) intgetElement(int n) intintintstatic MrcMessagegetPOM(int addressLo, int addressHi, int cv, int val) static MrcMessagegetReadCV(int cv) int(package private) static MrcMessagegetRouteMsg(int address, boolean closed) static MrcMessagegetSendFunction(int group, int addressLo, int addressHi, int data) static MrcMessagegetSendSpeed128(int addressLo, int addressHi, int speed) static MrcMessagegetSendSpeed28(int addressLo, int addressHi, int speed, boolean fwd) (package private) static MrcMessagegetSwitchMsg(int address, boolean closed) Get a message for a "Switch Position Normal" command to a specific accessory decoder on the layout.intstatic MrcMessagegetWriteCV(int cv, int val) booleanboolean(package private) intputHeader(int[] insert) void(package private) voidstatic MrcMessageToggle the AM/PM vs 24 hour modestatic MrcMessagesetClockRatio(int ratio) set the fast clock ratio ratio is integer and max of 60 and min of 1static MrcMessagesetClockTime(int hour, int minute) set the fast time clockvoidsetElement(int n, int v) (package private) voidsetMessageClass(int i) voidstatic MrcMessagestatic MrcMessageSet Track Power Off/Emergency Stopstatic MrcMessagevoidsetRetries(int i) void(package private) voidsetTimeout(int i) toString()booleanintvalue()
-
Field Details
-
source
-
msgClass
int msgClass -
replyExpected
boolean replyExpected -
SHORT_TIMEOUT
int SHORT_TIMEOUT -
SHORT_PROG_TIMEOUT
-
timeout
int timeout -
retries
int retries -
inError
boolean inError -
LONG_TIMEOUT
- See Also:
-
byteStream
byte[] byteStream
-
-
Constructor Details
-
MrcMessage
-
MrcMessage
-
MrcMessage
-
MrcMessage
-
-
Method Details
-
setSource
-
getSource
-
setMessageClass
-
getMessageClass
-
replyNotExpected
-
isReplyExpected
-
setTimeout
-
getTimeout
-
getRetries
-
setRetries
-
setMessageInError
-
isPacketInError
-
putHeader
-
toString
-
getSendSpeed128
-
getSendSpeed28
-
getSendFunction
-
getCheckSum
-
getReadCV
-
getPOM
-
getWriteCV
-
validCheckSum
-
value
-
getLocoAddress
-
getAccAddress
-
getAccState
-
setClockRatio
set the fast clock ratio ratio is integer and max of 60 and min of 1- Parameters:
ratio- value to set new clock speed- Returns:
- new message to set the clock speed ratio
-
setClockTime
set the fast time clock- Parameters:
hour- hour value for fast clockminute- minute value for fast clock- Returns:
- new message to set the hour/minutes of the fast clock
-
setClockAmPm
Toggle the AM/PM vs 24 hour mode- Returns:
- MrcMessage
-
setPowerOff
Set Track Power Off/Emergency Stop- Returns:
- MrcMessage
-
setPowerOn
-
getSwitchMsg
Get a message for a "Switch Position Normal" command to a specific accessory decoder on the layout.- Parameters:
address- address of turnoutclosed- position for the turnout- Returns:
- new message for getting switch posistion
-
getRouteMsg
-
setNoData
-
setByteStream
void setByteStream() -
getByteStream
byte[] getByteStream() -
getElement
-
getNumDataElements
-
setElement
-