jmri.jmrix.grapevine
Class SerialMessage

java.lang.Object
  extended by jmri.jmrix.AbstractMessage
      extended by jmri.jmrix.AbstractMRMessage
          extended by jmri.jmrix.grapevine.SerialMessage
All Implemented Interfaces:
Message

public class SerialMessage
extends AbstractMRMessage

Contains the data payload of a serial packet.

Author:
Bob Jacobsen Copyright (C) 2001,2003, 2006, 2007, 2008

Field Summary
 
Fields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT
 
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
 
Constructor Summary
SerialMessage()
           
SerialMessage(byte[] a)
          This ctor interprets the byte array as a sequence of characters to send.
SerialMessage(int len)
           
SerialMessage(SerialMessage m)
           
SerialMessage(String m)
          This ctor interprets the String as the exact sequence to send, byte-for-byte.
 
Method Summary
 String format()
          Format the reply as human-readable text.
 int getAddr()
           
static SerialMessage getPoll(int addr)
          For Grapevine, which doesn't have a data poll, the poll operation is only used to see that the nodes are present.
 int getReplyLen()
           
 boolean replyExpected()
          Is a reply expected to this message?
 void setBank(int b)
           
 void setParity()
           
 void setParity(int start)
           
 void setReplyLen(int len)
          Set the number of characters expected back from the command station.
 
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, setBinary, setNeededMode, setOpCode, setRetries, setTimeout, toString
 
Methods inherited from class jmri.jmrix.AbstractMessage
getElement, getNumDataElements, setElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SerialMessage

public SerialMessage()

SerialMessage

public SerialMessage(int len)

SerialMessage

public SerialMessage(SerialMessage m)

SerialMessage

public SerialMessage(String m)
This ctor interprets the String as the exact sequence to send, byte-for-byte.

Parameters:
m -

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
Method Detail

replyExpected

public boolean replyExpected()
Description copied from class: AbstractMRMessage
Is 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 transmitt the next message (if any).

Overrides:
replyExpected in class AbstractMRMessage

getAddr

public int getAddr()

getPoll

public static SerialMessage getPoll(int addr)
For Grapevine, which doesn't have a data poll, the poll operation is only used to see that the nodes are present. This is done by sending a "get software version" command.


setBank

public void setBank(int b)

setParity

public void setParity()

setParity

public void setParity(int start)

setReplyLen

public void setReplyLen(int len)
Set the number of characters expected back from the command station. Normally four, this is used to set other lengths for special cases, like a reply to a poll (software version) message.


getReplyLen

public int getReplyLen()

format

public String format()
Format the reply as human-readable text.



Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo