jmri.jmrix.sprog
Class SprogReply

java.lang.Object
  extended by jmri.jmrix.AbstractMessage
      extended by jmri.jmrix.AbstractMRReply
          extended by jmri.jmrix.sprog.SprogReply
All Implemented Interfaces:
Message

public class SprogReply
extends AbstractMRReply

SprogReply.java Description: Carries the reply to a SprogMessage

Author:
Bob Jacobsen Copyright (C) 2001, Andrew Berridge - refactored, cleaned up, Feb 2010

Field Summary
static int maxSize
           
 
Fields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZE
 
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
 
Constructor Summary
SprogReply()
           
SprogReply(SprogReply m)
          Create a new SprogReply as a deep copy of an existing SprogReply
SprogReply(String replyString)
           
SprogReply(String replyString, boolean isBoot)
          Create a SprogReply from a String
 
Method Summary
 boolean endBootloaderReply(SprogConstants.SprogState sprogState)
           
 boolean endBootReply()
           
 boolean endNormalReply()
           
 boolean getChecksum()
           
 boolean isError()
          Is this reply indicating that a general error has occurred?
 boolean isOverload()
          Is this reply indicating that an overload condition was detected?
 int match(String s)
          Returns the index of String s in the reply
protected  int skipPrefix(int index)
           
 boolean strip()
           
 String toString()
          Returns a string representation of this SprogReply
 int value()
          Extracts Read-CV returned value from a message.
 
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, getOpCode, isBinary, isRetransmittableErrorMsg, isUnsolicited, maxSize, pollValue, setBinary, setElement, setOpCode, setUnsolicited, skipWhiteSpace
 
Methods inherited from class jmri.jmrix.AbstractMessage
getElement, getNumDataElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

maxSize

public static final int maxSize
See Also:
Constant Field Values
Constructor Detail

SprogReply

public SprogReply()

SprogReply

public SprogReply(SprogReply m)
Create a new SprogReply as a deep copy of an existing SprogReply

Parameters:
m - the SprogReply to copy

SprogReply

public SprogReply(String replyString,
                  boolean isBoot)
Create a SprogReply from a String

Parameters:
replyString - a String containing the contents of the reply
isBoot - a boolean indicating if this is a boot reply

SprogReply

public SprogReply(String replyString)
Method Detail

skipPrefix

protected int skipPrefix(int index)
Specified by:
skipPrefix in class AbstractMRReply

isOverload

public boolean isOverload()
Is this reply indicating that an overload condition was detected?


isError

public boolean isError()
Is this reply indicating that a general error has occurred?


strip

public boolean strip()

getChecksum

public boolean getChecksum()

toString

public String toString()
Returns a string representation of this SprogReply

Specified by:
toString in interface Message
Overrides:
toString in class AbstractMRReply

value

public int value()
Extracts Read-CV returned value from a message. Returns -1 if message can't be parsed. SPROG is assumed to not be echoing commands. A reply to a command may include the prompt that was printed after the previous command Reply to a CV read is of the form " = hvv" where vv is the CV value in hex

Overrides:
value in class AbstractMRReply

match

public int match(String s)
Returns the index of String s in the reply

Overrides:
match in class AbstractMRReply

endNormalReply

public boolean endNormalReply()

endBootReply

public boolean endBootReply()

endBootloaderReply

public boolean endBootloaderReply(SprogConstants.SprogState sprogState)


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