|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.can.cbus.CbusCommandStation
public class CbusCommandStation
Implement CommandStation for CBUS communications. The intention is that, unlike some other systems, we will hold no or minimal command station state in the software model. The actual command station state should always be referred to.
| Constructor Summary | |
|---|---|
CbusCommandStation()
|
|
| Method Summary | |
|---|---|
boolean |
getHasServiceMode()
Does this command station have a "service mode", where it stops normal train operation while programming? |
boolean |
getInServiceMode()
If this command station has a service mode, is the command station currently in that mode? |
String |
getVersionString()
Provides an-implementation specific version string from the command station. |
static CbusCommandStation |
instance()
|
void |
message(CanMessage m)
|
void |
releaseSession(int handle)
Release a session freeing up the slot for reuse |
void |
reply(CanReply m)
|
void |
sendPacket(byte[] packet,
int repeats)
Send a specific packet to the rails. |
protected void |
setFunctions(int group,
int handle,
int functions)
Send a CBUS message to set functions |
void |
setSpeedDir(int handle,
int speed_dir)
Set loco speed and direction |
protected void |
setSpeedSteps(int handle,
int mode)
Send a CBUS message to change the session speed step mode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CbusCommandStation()
| Method Detail |
|---|
public static CbusCommandStation instance()
public void sendPacket(byte[] packet,
int repeats)
sendPacket in interface CommandStationpacket - Byte array representing the packet, including
the error-correction byte. Must not be null.repeats - Number of times to repeat the transmission,
but is ignored in the current implementationpublic void releaseSession(int handle)
handle - the handle for the session to be released
public void setSpeedDir(int handle,
int speed_dir)
handle - The handle of the session to which it appliesspeed_dir - Bit 7 is direction (1 = forward) 6:0 are speed
protected void setFunctions(int group,
int handle,
int functions)
group - The function grouphandle - The handle of the session for the loco being controlledfunctions - Function bits
protected void setSpeedSteps(int handle,
int mode)
mode - the speed step modepublic void message(CanMessage m)
message in interface CanListenerpublic void reply(CanReply m)
reply in interface CanListenerpublic boolean getHasServiceMode()
getHasServiceMode in interface DccCommandStationpublic boolean getInServiceMode()
getInServiceMode in interface DccCommandStationpublic String getVersionString()
getVersionString in interface DccCommandStation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||