Package jmri.jmrix.dccpp
Class DCCppCommandStation
java.lang.Object
jmri.jmrix.dccpp.DCCppCommandStation
- All Implemented Interfaces:
CommandStation
Defines the standard/common routines used in multiple classes related to the
DCC++ Command Station, on a DCC++ network.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanRemember whether or not in service mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBuild()Get the Build of the connected Command Station it is populated by response from the CS, initially "Unknown"protected intstatic intgetDCCAddressHigh(int address) Get the Upper byte of a locomotive address from the decimal locomotive address.static intgetDCCAddressLow(int address) Get the Lower byte of a locomotive address from the decimal locomotive address.intgetRegisterAddress(int num) intgetRegisterNum(int addr) Get the Station Type of the connected Command Station it is populated by response from the CS, initially "Unknown"getTrackMode(int i) Get the canonical version of the connected Command Station it is populated by response from the CS, so initially '0.0.0'Provide the version string returned during the initial check.booleanDoes this command station support the latest Current commands <JG>, <JI>, etc.?booleanDoes this command station require JMRI to send periodic function refresh packets?booleanCan this command station handle the newer (V4) function message format?booleanCan this command station handle the <#> request to get supported number of cabs(locos)?booleanDCC++ command station does provide Ops Mode.booleanCan this command station handle the newer (V4) program message formats?booleanCan this command station handle the Read with a starting value ('V'erify)booleanCan this command station handle the Servo and Vpin Turnout creation message formats?booleanDoes this command station need the throttle register to be sent?booleanDoes this command station require the new "J" commands for turnout definitions?voidreleaseRegister(int addr) intrequestNewRegister(int addr) booleansendPacket(byte[] packet, int repeats) Send a specific packet to the rails.voidprotected voidParse the DCC++ CS status response to pull out the base station version and software version.protected voidsetCommandStationMaxNumSlots(int newNumSlots) protected voidvoidvoidvoidsetTrackMode(int i, String mode) voidvoidsetVersion(String s) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.CommandStation
sendAccSignalDecoderPkt, sendAltAccSignalDecoderPkt
-
Field Details
-
mInServiceMode
boolean mInServiceModeRemember whether or not in service mode.
-
-
Constructor Details
-
DCCppCommandStation
public DCCppCommandStation() -
DCCppCommandStation
-
-
Method Details
-
setStationType
-
getStationType
Get the Station Type of the connected Command Station it is populated by response from the CS, initially "Unknown"- Returns:
- StationType
-
setBuild
-
getBuild
Get the Build of the connected Command Station it is populated by response from the CS, initially "Unknown"- Returns:
- Build
-
setVersion
-
getVersion
Get the canonical version of the connected Command Station it is populated by response from the CS, so initially '0.0.0'- Returns:
- Version
-
setCommandStationInfo
Parse the DCC++ CS status response to pull out the base station version and software version.- Parameters:
l- status response to query.
-
setCommandStationMaxNumSlots
-
setCommandStationMaxNumSlots
-
getCommandStationMaxNumSlots
-
getVersionString
Provide the version string returned during the initial check.- Returns:
- version string.
-
isOpsModePossible
DCC++ command station does provide Ops Mode.- Returns:
- always true.
-
isFunctionRefreshRequired
Does this command station require JMRI to send periodic function refresh packets?- Returns:
- true if required, false if not
-
isCurrentListSupported
Does this command station support the latest Current commands <JG>, <JI>, etc.?- Returns:
- true if supported, false if not
-
isReadStartValSupported
Can this command station handle the Read with a starting value ('V'erify)- Returns:
- true if yes or false if no
-
isServoTurnoutCreationSupported
Can this command station handle the Servo and Vpin Turnout creation message formats?- Returns:
- true if yes or false if no
-
isTurnoutIDsMessageRequired
Does this command station require the new "J" commands for turnout definitions?- Returns:
- true if yes or false if no
-
isThrottleRegisterRequired
Does this command station need the throttle register to be sent?- Returns:
- true if yes or false if no
-
isFunctionV4Supported
Can this command station handle the newer (V4) function message format?- Returns:
- true if yes or false if no
-
isProgramV4Supported
Can this command station handle the newer (V4) program message formats?- Returns:
- true if yes or false if no
-
isMaxNumSlotsMsgSupported
Can this command station handle the <#> request to get supported number of cabs(locos)?- Returns:
- true if yes or false if no
-
getDCCAddressLow
Get the Lower byte of a locomotive address from the decimal locomotive address.- Parameters:
address- loco address.- Returns:
- loco address byte lo.
-
getDCCAddressHigh
Get the Upper byte of a locomotive address from the decimal locomotive address.- Parameters:
address- loco address.- Returns:
- high byte of address.
-
sendPacket
Send a specific packet to the rails.- Specified by:
sendPacketin interfaceCommandStation- Parameters:
packet- Byte array representing the packet, including the error-correction byte. Must not be null.repeats- Number of times to repeat the transmission.- Returns:
trueif the operation succeeds,falseotherwise.
-
setTrafficController
-
setSystemConnectionMemo
-
getSystemConnectionMemo
-
getUserName
- Specified by:
getUserNamein interfaceCommandStation
-
getSystemPrefix
- Specified by:
getSystemPrefixin interfaceCommandStation
-
requestNewRegister
-
releaseRegister
-
getRegisterNum
-
getRegisterAddress
-
setTrackMode
-
getTrackModes
-
getTrackMode
-