Package jmri.jmrix.sprog.update
Class SprogVersionQuery
java.lang.Object
jmri.jmrix.sprog.update.SprogVersionQuery
- All Implemented Interfaces:
EventListener,SprogListener
Get the firmware version of the attached SPROG.
Updated April 2016 by Andrew Crosland: look for the correct replies, which may not be the very next message after a query is sent, due to slot manager traffic. Add Pi-SPROG version decoding.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int(package private) String(package private) SprogVersionQuery.QueryState(package private) SprogTrafficController(package private) Timer(package private) SprogVersionprotected static final Vector<SprogVersionListener> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidSprogListener notify Message (not used).voidSprogListener notifyReply listens to replies and looks for version reply.protected voidNotify all registered listeners of the SPROG version.voidRemove a SprogVersionListener.voidprotected voidrestartTimer(int delay) Internal routine to handle timer starts and restarts.protected voidInternal routine to restart timer with a long delay.protected voidInternal routine to stop timer, as all is well.protected voidtimeout()Internal routine to handle a timeout.
-
Field Details
-
replyString
-
tc
-
ver
-
state
-
LONG_TIMEOUT
- See Also:
-
timer
-
versionListeners
-
-
Constructor Details
-
SprogVersionQuery
-
-
Method Details
-
addSprogVersionListener
-
removeSprogVersionListener
Remove a SprogVersionListener. Stops Timer ( if running ), when no further Listeners are present.- Parameters:
l- the Listener to remove.
-
requestVersion
-
notifyVersion
Notify all registered listeners of the SPROG version.- Parameters:
v- version to send notify to
-
notifyMessage
SprogListener notify Message (not used).- Specified by:
notifyMessagein interfaceSprogListener
-
notifyReply
SprogListener notifyReply listens to replies and looks for version reply.- Specified by:
notifyReplyin interfaceSprogListener
-
timeout
Internal routine to handle a timeout. -
startLongTimer
Internal routine to restart timer with a long delay. -
stopTimer
Internal routine to stop timer, as all is well. -
restartTimer
Internal routine to handle timer starts and restarts.- Parameters:
delay- timer delay
-