jmri.jmrix.powerline
Class SerialMessage

java.lang.Object
  extended by jmri.jmrix.AbstractMessage
      extended by jmri.jmrix.AbstractMRMessage
          extended by jmri.jmrix.powerline.SerialMessage
All Implemented Interfaces:
Message
Direct Known Subclasses:
SpecificMessage, SpecificMessage, SpecificMessage, SpecificMessage

public abstract class SerialMessage
extends AbstractMRMessage

Contains the data payload of a serial packet.

The transmission protocol can come in one of several forms:

Author:
Bob Jacobsen Copyright (C) 2001,2003, 2006, 2007, 2008 Converted to multiple connection, kcameron Copyright (C) 2011

Field Summary
 
Fields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT
 
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
 
Constructor Summary
protected SerialMessage()
          Suppress the default ctor, as the length must always be specified
  SerialMessage(byte[] a, int l)
          This ctor interprets the byte array as a sequence of characters to send.
  SerialMessage(int l)
           
  SerialMessage(String m, int l)
          This ctor interprets the String as the exact sequence to send, byte-for-byte.
 
Method Summary
 int getAddr()
           
 boolean getInterlocked()
           
static SerialMessage getPoll(int addr)
           
 int getResponseLength()
           
 boolean isPoll()
           
 boolean isXmt()
           
 void setInterlocked(boolean v)
           
 void setResponseLength(int l)
           
abstract  String toMonitorString()
           
 
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, replyExpected, 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

protected SerialMessage()
Suppress the default ctor, as the length must always be specified


SerialMessage

public SerialMessage(int l)

SerialMessage

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

Parameters:
m -

SerialMessage

public SerialMessage(byte[] a,
                     int l)
This ctor interprets the byte array as a sequence of characters to send.

Parameters:
a - Array of bytes to send
Method Detail

setInterlocked

public void setInterlocked(boolean v)

getInterlocked

public boolean getInterlocked()

setResponseLength

public void setResponseLength(int l)

getResponseLength

public int getResponseLength()

toMonitorString

public abstract String toMonitorString()

isPoll

public boolean isPoll()

isXmt

public boolean isXmt()

getAddr

public int getAddr()

getPoll

public static SerialMessage getPoll(int addr)


Copyright © 1997 - 2011 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: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads