Package jmri.jmrix.can.cbus.node
Class CbusNodeCanListener
- java.lang.Object
-
- jmri.jmrix.can.cbus.node.CbusNodeCanListener
-
- All Implemented Interfaces:
java.util.EventListener
,AbstractMRListener
,CanListener
- Direct Known Subclasses:
CbusNodeFromBackup.DoNothingCanListener
,CbusSimCanListener
public class CbusNodeCanListener extends java.lang.Object implements CanListener
Class to represent a Processing of CAN Frames for a CbusNode.
-
-
Field Summary
Fields Modifier and Type Field Description CanSystemConnectionMemo
memo
-
Constructor Summary
Constructors Constructor Description CbusNodeCanListener(CanSystemConnectionMemo connmemo, CbusBasicNodeWithManagers node)
Create a new CbusNodeCanListener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Disconnects from networkvoid
message(CanMessage m)
Processes certain outgoing CAN Frames.void
reply(CanReply m)
Processes all incoming and certain outgoing CAN Frames Called when an incoming CanFrame is received from the CAN Network.void
setParamsFromSetup(int[] setupParams)
Temporarily store Node Parameters obtained from a Node requesting a Node Number-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.can.CanListener
addTc, addTc, removeTc, removeTc
-
-
-
-
Field Detail
-
memo
public final CanSystemConnectionMemo memo
-
-
Constructor Detail
-
CbusNodeCanListener
public CbusNodeCanListener(CanSystemConnectionMemo connmemo, CbusBasicNodeWithManagers node)
Create a new CbusNodeCanListener- Parameters:
connmemo
- The CAN Connection to listen to.node
- The Node
-
-
Method Detail
-
message
public void message(CanMessage m)
Processes certain outgoing CAN Frames.We don't know if it's this JMRI instance or something external teaching the node so we monitor them the same Called when an outgoing message is sent to the CAN Network.
- Specified by:
message
in interfaceCanListener
- Parameters:
m
- the CanMessage being sent.
-
reply
public void reply(CanReply m)
Processes all incoming and certain outgoing CAN Frames Called when an incoming CanFrame is received from the CAN Network.- Specified by:
reply
in interfaceCanListener
- Parameters:
m
- the CanReply being received.
-
setParamsFromSetup
public void setParamsFromSetup(int[] setupParams)
Temporarily store Node Parameters obtained from a Node requesting a Node NumberParameter array is not created until total number of parameters is known. This saves asking the Node for them.
- Parameters:
setupParams
- an int array in order of final 7 bytes of the CBUS_PARAMS node response
-
dispose
public void dispose()
Disconnects from network
-
-