Package jmri.jmrix.sprog
Class SprogReply
java.lang.Object
jmri.jmrix.AbstractMessage
jmri.jmrix.AbstractMRReply
jmri.jmrix.sprog.SprogReply
- All Implemented Interfaces:
Message
Carries the reply to a SprogMessage.
-
Field Summary
FieldsFields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZEFields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars -
Constructor Summary
ConstructorsConstructorDescriptionSprogReply(String replyString) SprogReply(String replyString, boolean isBoot) Create a SprogReply from a String.Create a new SprogReply as a deep copy of an existing SprogReply. -
Method Summary
Modifier and TypeMethodDescriptionbooleanBootloader will end with ETX with no preceding DLE.booleanNormal SPROG replies will end with the prompt for the next command.booleanCheck and strip checksum from a SPROG bootloader reply.intgetId()booleanisError()Is this reply indicating that a general error has occurred?booleanIs this reply indicating that an overload condition was detected?intFind a specific string in the reply.voidsetId(int id) protected intskipPrefix(int index) booleanstrip()Check and strip framing characters and DLE from a SPROG bootloader reply.toString()Return a string representation of this SprogReply.intvalue()Extract 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, skipWhiteSpaceMethods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrix.Message
toMonitorString
-
Field Details
-
maxSize
- See Also:
-
_id
-
-
Constructor Details
-
SprogReply
public SprogReply() -
SprogReply
Create a new SprogReply as a deep copy of an existing SprogReply.- Parameters:
m- the SprogReply to copy
-
SprogReply
Create a SprogReply from a String.- Parameters:
replyString- a String containing the contents of the replyisBoot- a boolean indicating if this is a boot reply
-
SprogReply
-
-
Method Details
-
setId
-
getId
-
skipPrefix
- Specified by:
skipPrefixin classAbstractMRReply
-
isOverload
Is this reply indicating that an overload condition was detected?- Returns:
- boolean true for overload
-
isError
Is this reply indicating that a general error has occurred?- Returns:
- boolean true for error message
-
strip
Check and strip framing characters and DLE from a SPROG bootloader reply.- Returns:
- boolean result of message validation
-
getChecksum
Check and strip checksum from a SPROG bootloader reply.Assumes framing and DLE chars have been stripped
- Returns:
- boolean result of checksum validation
-
toString
Return a string representation of this SprogReply.- Specified by:
toStringin interfaceMessage- Overrides:
toStringin classAbstractMRReply- Returns:
- String The string representation
-
value
Extract Read-CV returned value from a message.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:
valuein classAbstractMRReply- Returns:
- -1 if message can't be parsed
-
match
Find a specific string in the reply.- Overrides:
matchin classAbstractMRReply- Parameters:
s- string to look for- Returns:
- index of String s in the reply
-
endNormalReply
Normal SPROG replies will end with the prompt for the next command.- Returns:
- true if end of normal reply is found
-
endBootReply
Bootloader will end with ETX with no preceding DLE.- Returns:
- true if end of bootloader reply is found
-