jmri.jmrix.can.adapters.gridconnect
Class GridConnectMessage

java.lang.Object
  extended by jmri.jmrix.AbstractMessage
      extended by jmri.jmrix.AbstractMRMessage
          extended by jmri.jmrix.can.adapters.gridconnect.GridConnectMessage
All Implemented Interfaces:
Message

public class GridConnectMessage
extends AbstractMRMessage

Class for GridConnect messages for a CAN hardware adapter.

The GridConnect protocol encodes messages 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 N or R indicates a normal or remote frame d0 - d7 are the (up to) 8 data bytes

Author:
Andrew Crosland Copyright (C) 2008

Field Summary
 
Fields inherited from class jmri.jmrix.AbstractMRMessage
LONG_TIMEOUT, SHORT_TIMEOUT
 
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
 
Constructor Summary
GridConnectMessage()
           
GridConnectMessage(GridConnectMessage m)
           
GridConnectMessage(int i)
           
GridConnectMessage(int[] d)
           
 
Method Summary
 int getElement(int n)
           
 int getNumDataElements()
           
 void setByte(int val, int n)
          Set a byte as two ASCII hex digits Data bytes are encoded as two ASCII hex digits starting at byte 7 of the message.
 void setData(int[] d)
           
 void setElement(int n, int v)
           
 void setID(int id)
          Set the ID as three ASCII hex digits
 void setNumDataElements(int n)
           
 void setPri(int pri)
          Set the Priority
 
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setOpCode, setRetries, setTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridConnectMessage

public GridConnectMessage()

GridConnectMessage

public GridConnectMessage(int i)

GridConnectMessage

public GridConnectMessage(int[] d)

GridConnectMessage

public GridConnectMessage(GridConnectMessage m)
Method Detail

getNumDataElements

public int getNumDataElements()
Specified by:
getNumDataElements in interface Message
Overrides:
getNumDataElements in class AbstractMessage

setNumDataElements

public void setNumDataElements(int n)

getElement

public int getElement(int n)
Specified by:
getElement in interface Message
Overrides:
getElement in class AbstractMessage

setElement

public void setElement(int n,
                       int v)
Specified by:
setElement in interface Message
Overrides:
setElement in class AbstractMessage

setData

public void setData(int[] d)

setID

public void setID(int id)
Set the ID as three ASCII hex digits

Parameters:
id - A valid CBUS ID

setPri

public void setPri(int pri)
Set the Priority

Parameters:
pri - A valid CBUS Priority

setByte

public void setByte(int val,
                    int n)
Set a byte as two ASCII hex digits

Data bytes are encoded as two ASCII hex digits starting at byte 7 of the message.

Parameters:
val - the value to set
n - the index of the byte to be set


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: SourceForge_Logo