Class CbusSend


  • public class CbusSend
    extends java.lang.Object
    Class to send CAN Frames.

    Auto adds CBUS priority.

    • 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 mode
      void 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 sent
        sendReply - true to send as incoming CcanReply
        sendMessage - true to send as outgoing CanMessage
        delay - 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 node
        newevent - event variable event
        varindex - event variable index
        newval - 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 node
        newevent - 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 Number
        nextev - event index number
        nextevvar - 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 Number
        nextnodeparam - 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 Number
        nextnodenv - 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 Number
        nv - Node variable number
        newval - 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 Number
        canid - 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