Package jmri.jmrix.can.cbus
Class CbusSend
- java.lang.Object
-
- jmri.jmrix.can.cbus.CbusSend
-
public class CbusSend extends java.lang.Object
Class to send CAN Frames.Auto adds CBUS priority.
-
-
Constructor Summary
Constructors Constructor Description CbusSend(CanSystemConnectionMemo systemMemo)
ConstructorCbusSend(CanSystemConnectionMemo systemMemo, TextAreaFIFO txta)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aRST()
Sends a System Reset ARST OPC.void
cANID(int nodeinsetup, int canid)
Sends CANID OPC , Teach node a specific CANID.void
eNUM(int nodeinsetup)
Sends ENUM OPC , Force a self enumeration cycle for use with CAN.void
nERD(int nodeinsetup)
Sends NERD OPC , Request to read all node events.void
nNCLR(int nodeinsetup)
Sends NNCLR OPC , Clear all events from a node.void
nodeEnterLearnEvMode(int nn)
Sends NNLRN OPC , node enter learn mode.void
nodeExitLearnEvMode(int nn)
Sends NNULN OPC , node exit learn modevoid
nodeRequestParamSetup()
Sends RQNP OPC , Request Parameters from node in setup.void
nodeSetNodeNumber(int nn)
Sends SNN OPC , Set Node Number to Node in Setup.void
nodeTeachEventLearnMode(int newvalnd, int newevent, int varindex, int newval)
Sends EVLRN OPC , Event Learn when a node is in learn mode.void
nodeUnlearnEvent(int newvalnd, int newevent)
Sends EVULN OPC , Event Unlearn.void
nVRD(int nodeinsetup, int nextnodenv)
Sends NVRD OPC , Request read of a node variable.void
nVSET(int nodeinsetup, int nv, int newval)
Sends NVSET OPC , Node set individual NV.void
rEVAL(int nodeinsetup, int nextev, int nextevvar)
Sends REVAL OPC , Request for read of an event variable.void
rQEVN(int nodeinsetup)
Sends RQEVN OPC , Read number of stored events in node.void
rQmn()
Sends RQMN OPC , Request name from node.void
rQNPN(int nodeinsetup, int nextnodeparam)
Sends RQNPN OPC , Request read of a node parameter by index.void
searchForCommandStations()
Sends an RSTAT message to request details of any connected command stations.void
searchForNodes()
Sends CanMessage QNN OPC to get all nodes.void
sendWithDelay(CanReply r, java.lang.Boolean sendReply, java.lang.Boolean sendMessage, int delay)
Sends an outgoing CanMessage or incoming CanReply from a CanReply with a specified delay
-
-
-
Constructor Detail
-
CbusSend
public CbusSend(@Nonnull CanSystemConnectionMemo systemMemo, TextAreaFIFO txta)
Constructor- Parameters:
systemMemo
- System Connectiontxta
- a Text Area for any feedback messages
-
CbusSend
public CbusSend(CanSystemConnectionMemo systemMemo)
Constructor- Parameters:
systemMemo
- System Connection
-
-
Method Detail
-
sendWithDelay
public void sendWithDelay(CanReply r, java.lang.Boolean sendReply, java.lang.Boolean sendMessage, int delay)
Sends an outgoing CanMessage or incoming CanReply from a CanReply with a specified delay- Parameters:
r
- A CanReply Can Frame which will be sentsendReply
- true to send as incoming CcanReplysendMessage
- true to send as outgoing CanMessagedelay
- delay in ms
-
nodeExitLearnEvMode
public void nodeExitLearnEvMode(int nn)
Sends NNULN OPC , node exit learn mode- Parameters:
nn
- Node Number
-
nodeEnterLearnEvMode
public void nodeEnterLearnEvMode(int nn)
Sends NNLRN OPC , node enter learn mode.- Parameters:
nn
- Node Number
-
nodeSetNodeNumber
public void nodeSetNodeNumber(int nn)
Sends SNN OPC , Set Node Number to Node in Setup.- Parameters:
nn
- Node Number
-
nodeRequestParamSetup
public void nodeRequestParamSetup()
Sends RQNP OPC , Request Parameters from node in setup.
-
nodeTeachEventLearnMode
public void nodeTeachEventLearnMode(int newvalnd, int newevent, int varindex, int newval)
Sends EVLRN OPC , Event Learn when a node is in learn mode.- Parameters:
newvalnd
- event variable nodenewevent
- event variable eventvarindex
- event variable indexnewval
- event variable value
-
nodeUnlearnEvent
public void nodeUnlearnEvent(int newvalnd, int newevent)
Sends EVULN OPC , Event Unlearn. when a node is in learn mode- Parameters:
newvalnd
- event variable nodenewevent
- event variable event
-
rEVAL
public void rEVAL(int nodeinsetup, int nextev, int nextevvar)
Sends REVAL OPC , Request for read of an event variable.- Parameters:
nodeinsetup
- Node Numbernextev
- event index numbernextevvar
- event variable number
-
rQNPN
public void rQNPN(int nodeinsetup, int nextnodeparam)
Sends RQNPN OPC , Request read of a node parameter by index.- Parameters:
nodeinsetup
- Node Numbernextnodeparam
- parameter index number
-
searchForNodes
public void searchForNodes()
Sends CanMessage QNN OPC to get all nodes.
-
searchForCommandStations
public void searchForCommandStations()
Sends an RSTAT message to request details of any connected command stations. Responses are received by the CBUS node table.
-
nVRD
public void nVRD(int nodeinsetup, int nextnodenv)
Sends NVRD OPC , Request read of a node variable.- Parameters:
nodeinsetup
- Node Numbernextnodenv
- variable number
-
nVSET
public void nVSET(int nodeinsetup, int nv, int newval)
Sends NVSET OPC , Node set individual NV. If (contrary to CBUS spec), the node is required to be in Event Learn Mode before setting a NV, this will be done within this function, assuming that the node is visible to the memo CbusNodeTableDataModel .- Parameters:
nodeinsetup
- Node Numbernv
- Node variable numbernewval
- Node variable number value
-
rQEVN
public void rQEVN(int nodeinsetup)
Sends RQEVN OPC , Read number of stored events in node.nb, NOT max events capable
- Parameters:
nodeinsetup
- Node Number
-
nERD
public void nERD(int nodeinsetup)
Sends NERD OPC , Request to read all node events.- Parameters:
nodeinsetup
- Node Number
-
aRST
public void aRST()
Sends a System Reset ARST OPC. Full system reset
-
eNUM
public void eNUM(int nodeinsetup)
Sends ENUM OPC , Force a self enumeration cycle for use with CAN.- Parameters:
nodeinsetup
- Node Number
-
cANID
public void cANID(int nodeinsetup, int canid)
Sends CANID OPC , Teach node a specific CANID.- Parameters:
nodeinsetup
- Node Numbercanid
- new CAN ID ( min 1, max 99 )
-
nNCLR
public void nNCLR(int nodeinsetup)
Sends NNCLR OPC , Clear all events from a node.Node must be in Learn Mode to take effect
- Parameters:
nodeinsetup
- Node Number
-
rQmn
public void rQmn()
Sends RQMN OPC , Request name from node.Node must be in Setup Mode to take effect
-
-