Package com.reduxrobotics.canand
Class CANBus
java.lang.Object
com.reduxrobotics.canand.CANBus
Class representing CAN buses that may exist on a robot.
Currently, only the Rio's onboard CAN bus is supported.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CANBus
byDescriptor
(byte busDescriptor) Returns a CANBus object corresponding to a specific bus descriptor value.boolean
Returns whether two CANBus objects refer to the same bus.byte
Returns the descriptor ID associated with the CAN bus object.static CANBus
Returns a CANBus object representing the roboRIO's onboard bus.
-
Method Details
-
getRioBus
Returns a CANBus object representing the roboRIO's onboard bus.- Returns:
- an object representing the Rio's bus (descriptor = 0)
-
byDescriptor
Returns a CANBus object corresponding to a specific bus descriptor value. It is generally preferable to use this function instead of the constructor to avoid object creation churn.- Parameters:
busDescriptor
- the descriptor value- Returns:
- a new CANBus object associated with that bus descriptor. Equality can be checked
between two CANBus objects with
equals(java.lang.Object)
-
getDescriptor
public byte getDescriptor()Returns the descriptor ID associated with the CAN bus object. Generally not needed to be used directly.- Returns:
- the descriptor ID.
-
equals
Returns whether two CANBus objects refer to the same bus.
-