jmri.jmrix.can
Class AbstractCanTrafficController
java.lang.Object
jmri.jmrix.AbstractMRTrafficController
jmri.jmrix.can.AbstractCanTrafficController
- All Implemented Interfaces:
- CanInterface
- Direct Known Subclasses:
- TrafficController
public abstract class AbstractCanTrafficController
- extends AbstractMRTrafficController
- implements CanInterface
Abstract base for TrafficControllers in a CANbus based Message/Reply protocol.
AbstractMRTrafficController is extended to allow for the translation between
CAN messages and the message format of the CAN adapter that connects to the
layout.
- Author:
- Andrew Crosland Copyright (C) 2008
| Fields inherited from class jmri.jmrix.AbstractMRTrafficController |
allowUnexpectedReply, cmdListeners, controller, IDLESTATE, istream, mCurrentMode, mCurrentState, mLastSender, mWaitBeforePoll, NORMALMODE, NOTIFIEDSTATE, OKSENDMSGSTATE, ostream, PROGRAMINGMODE, replyInDispatch, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, xmtRunnable |
| Methods inherited from class jmri.jmrix.AbstractMRTrafficController |
addHeaderToOutput, addListener, addTrailerToOutput, canReceive, connectionWarn, connectPort, disconnectPort, endOfMessage, enterProgModeDelayTime, finalize, forwardMessage, forwardReply, getPortName, handleTimeout, hasTimeouts, lengthOfByteStream, loadChars, newRcvNotifier, newReply, notifyMessage, notifyReply, portReadyToSend, portWarn, programmerIdle, readByteProtected, receiveLoop, removeListener, reportReceiveLoopException, resetTimeout, sendMessage, setAllowUnexpectedReply, setInstance, status, waitForStartOfReply |
AbstractCanTrafficController
public AbstractCanTrafficController()
addCanListener
public void addCanListener(CanListener l)
- Specified by:
addCanListener in interface CanInterface
removeCanListener
public void removeCanListener(CanListener l)
- Specified by:
removeCanListener in interface CanInterface
forwardToPort
protected void forwardToPort(AbstractMRMessage m,
AbstractMRListener reply)
- Actually transmits the next message to the port
Overridden to include translation to the correct CAN hardware message format
- Overrides:
forwardToPort in class AbstractMRTrafficController
pollMessage
protected AbstractMRMessage pollMessage()
- Description copied from class:
AbstractMRTrafficController
- Invoked if it's appropriate to do low-priority polling of the
command station, this should return the next message to send,
or null if the TC should just sleep.
- Specified by:
pollMessage in class AbstractMRTrafficController
pollReplyHandler
protected AbstractMRListener pollReplyHandler()
- Specified by:
pollReplyHandler in class AbstractMRTrafficController
enterProgMode
protected AbstractMRMessage enterProgMode()
- Specified by:
enterProgMode in class AbstractMRTrafficController
enterNormalMode
protected AbstractMRMessage enterNormalMode()
- Specified by:
enterNormalMode in class AbstractMRTrafficController
newMessage
protected abstract AbstractMRMessage newMessage()
- Get the correct concrete class for the hardware connection message
decodeFromHardware
public abstract CanReply decodeFromHardware(AbstractMRReply m)
encodeForHardware
public abstract AbstractMRMessage encodeForHardware(CanMessage m)
handleOneIncomingReply
public void handleOneIncomingReply()
throws IOException
- Handle each reply when complete.
Overridden to include translation form the CAN hardware format
- Overrides:
handleOneIncomingReply in class AbstractMRTrafficController
- Throws:
IOException
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: