Package jmri.jmrix.srcp
Class SRCPMessage
java.lang.Object
jmri.jmrix.AbstractMessage
jmri.jmrix.AbstractMRMessage
jmri.jmrix.srcp.SRCPMessage
- All Implemented Interfaces:
Message
Encodes a message to an SRCP server. The SRCPReply class handles the response
from the command station.
The
SRCPReply class handles the response from the command station.-
Field Summary
FieldsFields inherited from class jmri.jmrix.AbstractMRMessage
SHORT_TIMEOUTFields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SRCPMessagegetConfirmDirectBitCV(int bus, int cv, int bit, int val) static SRCPMessagegetConfirmDirectCV(int bus, int cv, int val) static SRCPMessagegetConfirmRegister(int bus, int reg, int val) static SRCPMessagestatic SRCPMessagegetExitProgMode(int bus) static SRCPMessagestatic SRCPMessagegetProgMode(int bus) static SRCPMessagegetReadDirectBitCV(int bus, int cv, int bit) static SRCPMessagegetReadDirectCV(int bus, int cv) static SRCPMessagegetReadRegister(int bus, int reg) static SRCPMessagegetWriteDirectBitCV(int bus, int cv, int bit, int val) static SRCPMessagegetWriteDirectCV(int bus, int cv, int val) static SRCPMessagegetWriteRegister(int bus, int reg, int val) booleanDetrmine if the message turns on track powerbooleanDetrmine if the message turns off track powerMethods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setOpCode, setRetries, setTimeout, toStringMethods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCode, setElementMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrix.Message
toMonitorString
-
Field Details
-
LONG_TIMEOUT
- See Also:
-
-
Constructor Details
-
SRCPMessage
public SRCPMessage() -
SRCPMessage
-
SRCPMessage
-
SRCPMessage
-
-
Method Details
-
isKillMain
Detrmine if the message turns off track power- Returns:
- true if the messages is a track power off message,false otherwise
-
isEnableMain
Detrmine if the message turns on track power- Returns:
- true if the messages is a track power on message,false otherwise
-
getEnableMain
- Returns:
- an SRCPMessage to turn the track power on
-
getKillMain
- Returns:
- an SRCPMessage to turn the track power off
-
getProgMode
- Parameters:
bus- a bus number- Returns:
- an SRCPMessage to initialize programming on the given bus.
-
getExitProgMode
- Parameters:
bus- a bus number- Returns:
- an SRCPMessage to terminate programming on the given bus.
-
getReadDirectCV
- Parameters:
bus- a bus numbercv- the CV to read.- Returns:
- an SRCPMessage to read the given CV in direct mode the given bus.
-
getConfirmDirectCV
- Parameters:
bus- a bus numbercv- the CV to read.val- a value for the CV.- Returns:
- an SRCPMessage to check the given cv has the given val using the given bus.
-
getWriteDirectCV
- Parameters:
bus- a bus numbercv- the CV to write.val- a value for the CV.- Returns:
- an SRCPMessage to write the given value to the provided cv using the given bus.
-
getReadDirectBitCV
- Parameters:
bus- a bus numbercv- the CV to read.bit- the bit to read.- Returns:
- an SRCPMessage to read the given bit of the given CV uisng the provided bus.
-
getConfirmDirectBitCV
- Parameters:
bus- a bus numbercv- the CV to read.bit- the bit to read.val- the value to check- Returns:
- an SRCPMessage to verify the given bit of the given CV has the given val uisng the provided bus.
-
getWriteDirectBitCV
- Parameters:
bus- a bus numbercv- the CV to write.bit- the bit to writeval- the value to write- Returns:
- an SRCPMessage to write the given value to the given bit of the given CV uisng the provided bus.
-
getReadRegister
- Parameters:
bus- a bus numberreg- a register to read. Restricted to valuse less than 8.- Returns:
- an SRCPMessage to read the provided register using the given bus.
- Throws:
IllegalArgumentException- if the register value is out of range.
-
getConfirmRegister
- Parameters:
bus- a bus numberreg- a register to read. Restricted to valuse less than 8.val- a value for the register- Returns:
- an SRCPMessage to verify the provided register has the expected val using the given bus.
- Throws:
IllegalArgumentException- if the register value is out of range.
-
getWriteRegister
- Parameters:
bus- a bus numberreg- a register to write. Restricted to valuse less than 8.val- a value for the register- Returns:
- an SRCPMessage to write the given value to the provided register using the given bus.
- Throws:
IllegalArgumentException- if the register value is out of range.
-