Class CanandEventLoop

java.lang.Object
com.reduxrobotics.canand.CanandEventLoop
All Implemented Interfaces:
Runnable

public class CanandEventLoop extends Object implements Runnable
Class that runs the CAN packet ingest loop, and starts the CANLink interface.

In order to start the Redux CANLink server, either instantiate any Redux device in your robot code or call

 CanandEventLoop.getInstance();
 
somewhere in an init function
  • Method Details

    • getInstance

      public static CanandEventLoop getInstance()
      Returns a handle to the event loop. Starts it if not started.
      Returns:
      the singleton instance
    • addListener

      public void addListener(CanandDevice listener)
      Adds a listener for CAN messages to the event loop.
      Parameters:
      listener - a CanandDevice
    • removeListener

      public void removeListener(CanandDevice listener)
      Removes a listener for CAN messages, if it is in fact listening.
      Parameters:
      listener - the CanandDevice to remove
    • getListeners

      public List<CanandDevice> getListeners()
      Returns the current list of listeners
      Returns:
      List of CanandDevice
    • run

      public void run()
      Specified by:
      run in interface Runnable