Package jmri.jmrix.tmcc
Class SerialMessage
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRMessage
-
- jmri.jmrix.tmcc.SerialMessage
-
- All Implemented Interfaces:
Message
public class SerialMessage extends AbstractMRMessage
Contains the data payload of a TMCC serial packet.Note that only the payload, not the header or trailer, nor the padding DLE characters are included. These are added during transmission.
-
-
Field Summary
-
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 SerialMessage()
SerialMessage(byte[] a)
This ctor interprets the byte array as a sequence of characters to send.SerialMessage(int value)
This ctor takes an int value for the 16 bit data content, with an optional leading byte.SerialMessage(java.lang.String m)
This ctor interprets the String as the exact sequence to send, byte-for-byte.SerialMessage(SerialMessage m)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAsWord()
void
putAsWord(int val)
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, setElement
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.Message
toMonitorString
-
-
-
-
Constructor Detail
-
SerialMessage
public SerialMessage()
-
SerialMessage
public SerialMessage(SerialMessage m)
-
SerialMessage
public SerialMessage(java.lang.String m)
This ctor interprets the String as the exact sequence to send, byte-for-byte.- Parameters:
m
- string form of bytes to send
-
SerialMessage
public SerialMessage(byte[] a)
This ctor interprets the byte array as a sequence of characters to send.- Parameters:
a
- Array of bytes to send
-
SerialMessage
public SerialMessage(int value)
This ctor takes an int value for the 16 bit data content, with an optional leading byte. If the value is greater than 0xFFFF, i.e. the upper byte of three is non-zero, the upper byte is used as the op code, otherwise 0xFE (TMCC 1) will be used.- Parameters:
value
- The value stored in the content of the packet
-
-