Package com.reduxrobotics.canand
Class CanandEventLoop
java.lang.Object
com.reduxrobotics.canand.CanandEventLoop
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptionvoid
addListener
(CanandDevice listener) Adds a listener for CAN messages to the event loop.static CanandEventLoop
Returns a handle to the event loop.Returns the current list of listenersvoid
removeListener
(CanandDevice listener) Removes a listener for CAN messages, if it is in fact listening.void
run()
-
Method Details
-
getInstance
Returns a handle to the event loop. Starts it if not started.- Returns:
- the singleton instance
-
addListener
Adds a listener for CAN messages to the event loop.- Parameters:
listener
- aCanandDevice
-
removeListener
Removes a listener for CAN messages, if it is in fact listening.- Parameters:
listener
- theCanandDevice
to remove
-
getListeners
Returns the current list of listeners- Returns:
List
ofCanandDevice
-
run
public void run()
-