jmri.jmrix.can.adapters.gridconnect.canrs
Class MergTrafficController

java.lang.Object
  extended by jmri.jmrix.AbstractMRTrafficController
      extended by jmri.jmrix.can.AbstractCanTrafficController
          extended by jmri.jmrix.can.TrafficController
              extended by jmri.jmrix.can.adapters.gridconnect.GcTrafficController
                  extended by jmri.jmrix.can.adapters.gridconnect.canrs.MergTrafficController
All Implemented Interfaces:
CanInterface

public class MergTrafficController
extends GcTrafficController

Traffic controller for the MERG varient of the GridConnect protocol.

MERG CAN-RS/CAN-USB uses messages transmitted as an ASCII string of up to 24 characters of the form: :ShhhhNd0d1d2d3d4d5d6d7; The S indicates a standard CAN frame hhhh is the two byte header (11 useful bits), left justified on send to adapter N or R indicates a normal or remote frame d0 - d7 are the (up to) 8 data bytes

Author:
Andrew Crosland Copyright (C) 2008

Nested Class Summary
 
Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier
 
Field Summary
 
Fields inherited from class jmri.jmrix.can.adapters.gridconnect.GcTrafficController
BOOTMODE, NORMAL
 
Fields inherited from class jmri.jmrix.can.TrafficController
_canid, self
 
Fields inherited from class jmri.jmrix.AbstractMRTrafficController
allowUnexpectedReply, AUTORETRYSTATE, cmdListeners, controller, flushReceiveChars, IDLESTATE, istream, mCurrentMode, mCurrentState, mLastSender, mWaitBeforePoll, NORMALMODE, NOTIFIEDSTATE, OKSENDMSGSTATE, ostream, POLLSTATE, PROGRAMINGMODE, rcvException, replyInDispatch, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, waitTimePoll, xmtException, xmtRunnable
 
Constructor Summary
MergTrafficController()
           
 
Method Summary
 CanReply decodeFromHardware(AbstractMRReply m)
          Make a CanReply from a MergReply reply
 AbstractMRMessage encodeForHardware(CanMessage m)
          Encode a CanMessage for the hardware
static TrafficController instance()
          static function returning the CanTrafficController instance to use.
protected  AbstractMRMessage newMessage()
          Get the correct concrete class for the hardware connection message
protected  AbstractMRReply newReply()
           
 
Methods inherited from class jmri.jmrix.can.adapters.gridconnect.GcTrafficController
addTrailerToOutput, endOfMessage, forwardMessage, forwardReply, getgcState, isBootMode, lengthOfByteStream, loadChars, sendCanMessage, setgcState
 
Methods inherited from class jmri.jmrix.can.TrafficController
getCanid, setInstance
 
Methods inherited from class jmri.jmrix.can.AbstractCanTrafficController
addCanListener, enterNormalMode, enterProgMode, forwardToPort, handleOneIncomingReply, pollMessage, pollReplyHandler, removeCanListener
 
Methods inherited from class jmri.jmrix.AbstractMRTrafficController
addHeaderToOutput, addListener, canReceive, connectionWarn, connectPort, disconnectPort, enterProgModeDelayTime, finalize, getLastSender, getPortName, getSelfLock, handleTimeout, hasTimeouts, newRcvNotifier, notifyMessage, notifyReply, portReadyToSend, portWarn, portWarnTCP, programmerIdle, readByteProtected, receiveLoop, removeListener, reportReceiveLoopException, resetTimeout, sendMessage, setAllowUnexpectedReply, status, terminate, transmitWait, waitForStartOfReply
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.jmrix.can.CanInterface
status
 

Constructor Detail

MergTrafficController

public MergTrafficController()
Method Detail

instance

public static TrafficController instance()
static function returning the CanTrafficController instance to use.

Returns:
The registered SprogTrafficController instance for general use, if need be creating one.

newMessage

protected AbstractMRMessage newMessage()
Description copied from class: AbstractCanTrafficController
Get the correct concrete class for the hardware connection message

Overrides:
newMessage in class GcTrafficController

decodeFromHardware

public CanReply decodeFromHardware(AbstractMRReply m)
Make a CanReply from a MergReply reply

Overrides:
decodeFromHardware in class GcTrafficController

encodeForHardware

public AbstractMRMessage encodeForHardware(CanMessage m)
Encode a CanMessage for the hardware

Overrides:
encodeForHardware in class GcTrafficController

newReply

protected AbstractMRReply newReply()
Overrides:
newReply in class GcTrafficController


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