Package jmri.jmrix.openlcb
Class OlcbCommandStation
- java.lang.Object
-
- jmri.jmrix.openlcb.OlcbCommandStation
-
- All Implemented Interfaces:
CommandStation
public class OlcbCommandStation extends java.lang.Object implements CommandStation
OpenLcb implementation of part of the CommandStation interface.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CanSystemConnectionMemo
memo
-
Constructor Summary
Constructors Constructor Description OlcbCommandStation(CanSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getSystemPrefix()
java.lang.String
getUserName()
void
sendAccSignalDecoderPkt(int address, int aspect, int count)
As a shortcut, and to allow for command station types that cannot sent generic packets to the rails, we provide this method to specifically send Accessory Signal Decoder Packets.void
sendAltAccSignalDecoderPkt(int address, int aspect, int count)
As a shortcut, and to allow for command station types that cannot sent generic packets to the rails, we provide this method to specifically send the alternate form of Accessory Signal Decoder Packets.boolean
sendPacket(byte[] packet, int repeats)
OpenLCB/LCC does not have a complete, generic process for commanding that a generic DCC packet be sent to the rails.
-
-
-
Constructor Detail
-
OlcbCommandStation
public OlcbCommandStation(CanSystemConnectionMemo memo)
-
-
Method Detail
-
sendPacket
public boolean sendPacket(byte[] packet, int repeats)
OpenLCB/LCC does not have a complete, generic process for commanding that a generic DCC packet be sent to the rails.For now, this method just logs an error when invokved
- Specified by:
sendPacket
in 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, capped at 9- Returns:
true
if the operation succeeds,false
otherwise.
-
getUserName
public java.lang.String getUserName()
- Specified by:
getUserName
in interfaceCommandStation
-
getSystemPrefix
public java.lang.String getSystemPrefix()
- Specified by:
getSystemPrefix
in interfaceCommandStation
-
sendAccSignalDecoderPkt
public void sendAccSignalDecoderPkt(int address, int aspect, int count)
Description copied from interface:CommandStation
As a shortcut, and to allow for command station types that cannot sent generic packets to the rails, we provide this method to specifically send Accessory Signal Decoder Packets.It's equivalent to calling
NmraPacket.accSignalDecoderPkt(int, int)
and sending the resulting packet to the rails- Specified by:
sendAccSignalDecoderPkt
in interfaceCommandStation
- Parameters:
address
- The DCC signal decoder address to useaspect
- The signal aspect to sendcount
- the number of times to repeat the send
-
sendAltAccSignalDecoderPkt
public void sendAltAccSignalDecoderPkt(int address, int aspect, int count)
Description copied from interface:CommandStation
As a shortcut, and to allow for command station types that cannot sent generic packets to the rails, we provide this method to specifically send the alternate form of Accessory Signal Decoder Packets.It's equivalent to calling
NmraPacket.altAccSignalDecoderPkt(int, int)
and sending the resulting packet to the rails- Specified by:
sendAltAccSignalDecoderPkt
in interfaceCommandStation
- Parameters:
address
- The DCC signal decoder address to useaspect
- The signal aspect to sendcount
- the number of times to repeat the send
-
-