Package jmri.jmrix.maple
Class SerialMessage
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRMessage
-
- jmri.jmrix.maple.SerialMessage
-
- All Implemented Interfaces:
Message
public class SerialMessage extends AbstractMRMessage
Contains the data payload of a 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)Deprecated, for removal: This API element is subject to removal in a future version.5.13.5, unused, requires further development.SerialMessage(int i)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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAddress()intgetNumItems()static SerialMessagegetPoll(int UA, int startAdd, int count)intgetUA()booleanisInit()booleanisPoll()booleanisXmt()booleanreplyExpected()Is a reply expected to this message?(package private) voidsetChecksum(int index)protected voidsetNoReply()java.lang.StringtoString()-
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, 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(int i)
-
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- message string.
-
SerialMessage
@Deprecated(since="5.13.5", forRemoval=true) public SerialMessage(byte[] a)Deprecated, for removal: This API element is subject to removal in a future version.5.13.5, unused, requires further development.This ctor interprets the byte array as a sequence of characters to send.- Parameters:
a- Array of bytes to send
-
-
Method Detail
-
toString
public java.lang.String toString()
Description copied from interface:Message- Specified by:
toStringin interfaceMessage- Overrides:
toStringin classAbstractMRMessage
-
setNoReply
protected void setNoReply()
-
replyExpected
public boolean 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.
-
isPoll
public boolean isPoll()
-
isXmt
public boolean isXmt()
-
isInit
public boolean isInit()
-
getUA
public int getUA()
-
getAddress
public int getAddress()
-
getNumItems
public int getNumItems()
-
getPoll
public static SerialMessage getPoll(int UA, int startAdd, int count)
-
setChecksum
void setChecksum(int index)
-
-