Package com.reduxrobotics.canand
Class MessageBus
java.lang.Object
com.reduxrobotics.canand.MessageBus
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 MessageBusbyBusString(String busString) Gets a MessageBus instance from a bus string.static MessageBusbyDescriptor(int busDescriptor) Returns an object corresponding to a specific bus descriptor value.booleanReturns whether two bus objects refer to the same bus.intReturns the descriptor ID associated with the CAN bus object.static MessageBusReturns an object representing the roboRIO's onboard bus.static MessageBusgetSystemCoreBus(int idx) Returns an object representing the specified SystemCore bus index.
-
Method Details
-
getRioBus
Returns an object representing the roboRIO's onboard bus.- Returns:
- an object representing the Rio's bus (descriptor = 0)
-
getSystemCoreBus
Returns an object representing the specified SystemCore bus index. Do not use this on a roboRIO.- Parameters:
idx- bus index.- Returns:
- object
-
byDescriptor
Returns an 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 bus object associated with that bus descriptor. Equality can be checked between two bus objects with
equals(java.lang.Object)
-
byBusString
Gets a MessageBus instance from a bus string.- Parameters:
busString- bus string.- Returns:
- bus object
-
getDescriptor
public int 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 bus objects refer to the same bus.
-