Package jmri.jmrix.loconet.locoio
Class LocoIO
- java.lang.Object
-
- jmri.jmrix.loconet.locoio.LocoIO
-
public class LocoIO extends java.lang.Object
Manage the communication to/from a LocoIO board. Uses the LOCONETSV1MODE programming mode. Uses LnProgrammer LOCOIO_PEER_CODE_SV_VER1 message format, comparable to DecoderPro LOCONETSV1MODE Currently (4.11.6) this tool does not work with the HDL LocoIO rev 3 and newer boards, with risk of breaking the stored config.
-
-
Field Summary
Fields Modifier and Type Field Description static int
LOCOIO_BROADCAST_ADDRESS
static int
LOCOIO_PEER_CODE_7BIT_ADDRS
static int
LOCOIO_PEER_CODE_ANSI_TEXT
static int
LOCOIO_PEER_CODE_SV_VER1
static int
LOCOIO_PEER_CODE_SV_VER2
static int
LOCOIO_SV_READ
static int
LOCOIO_SV_WRITE
-
Constructor Summary
Constructors Constructor Description LocoIO()
Create a new instance of LocoIO.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
probeLocoIOs(LnTrafficController ln)
Send out a probe of all connected LocoIO units on a given LocoNet connection.static void
programLocoIOAddress(int address, int subAddress, LnTrafficController ln)
Compose and send a message out onto LocoNet changing the LocoIO hardware board address of all connected LocoIO boards.static LocoNetMessage
readCV(int locoIOAddress, int locoIOSubAddress, int cv)
Compose a LocoNet message from the given ingredients for reading the value of one specific SV from a given LocoIO.static int
SENSOR_ADR(int a1, int a2)
static LocoNetMessage
writeCV(int locoIOAddress, int locoIOSubAddress, int cv, int data)
Compose a LocoNet message from the given ingredients for reading the value of one specific SV from a given LocoIO.
-
-
-
Field Detail
-
LOCOIO_SV_WRITE
public static final int LOCOIO_SV_WRITE
- See Also:
- Constant Field Values
-
LOCOIO_SV_READ
public static final int LOCOIO_SV_READ
- See Also:
- Constant Field Values
-
LOCOIO_BROADCAST_ADDRESS
public static final int LOCOIO_BROADCAST_ADDRESS
- See Also:
- Constant Field Values
-
LOCOIO_PEER_CODE_7BIT_ADDRS
public static final int LOCOIO_PEER_CODE_7BIT_ADDRS
- See Also:
- Constant Field Values
-
LOCOIO_PEER_CODE_ANSI_TEXT
public static final int LOCOIO_PEER_CODE_ANSI_TEXT
- See Also:
- Constant Field Values
-
LOCOIO_PEER_CODE_SV_VER1
public static final int LOCOIO_PEER_CODE_SV_VER1
- See Also:
- Constant Field Values
-
LOCOIO_PEER_CODE_SV_VER2
public static final int LOCOIO_PEER_CODE_SV_VER2
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LocoIO
public LocoIO()
Create a new instance of LocoIO.
-
-
Method Detail
-
SENSOR_ADR
public static int SENSOR_ADR(int a1, int a2)
-
readCV
public static LocoNetMessage readCV(int locoIOAddress, int locoIOSubAddress, int cv)
Compose a LocoNet message from the given ingredients for reading the value of one specific SV from a given LocoIO.- Parameters:
locoIOAddress
- base address of the LocoIO board to read fromlocoIOSubAddress
- subAddress of the LocoIO boardcv
- the SV index to query- Returns:
- complete message to send
-
writeCV
public static LocoNetMessage writeCV(int locoIOAddress, int locoIOSubAddress, int cv, int data)
Compose a LocoNet message from the given ingredients for reading the value of one specific SV from a given LocoIO.- Parameters:
locoIOAddress
- base address of the LocoIO board to read fromlocoIOSubAddress
- subAddress of the LocoIO boardcv
- the SV index to changedata
- the new value to store in the board's SV- Returns:
- complete message to send
-
programLocoIOAddress
public static void programLocoIOAddress(int address, int subAddress, LnTrafficController ln)
Compose and send a message out onto LocoNet changing the LocoIO hardware board address of all connected LocoIO boards.User is warned that this is a broadcast type operation.
- Parameters:
address
- the new base address of the LocoIO board to changesubAddress
- the new subAddress of the boardln
- the TrafficController to use for sending the message
-
probeLocoIOs
public static void probeLocoIOs(LnTrafficController ln)
Send out a probe of all connected LocoIO units on a given LocoNet connection.- Parameters:
ln
- the TrafficController to use for sending the message
-
-