Class DeviceInformation

java.lang.Object
com.team2813.lib2813.vendor.ctre.DeviceInformation

public final class DeviceInformation extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    DeviceInformation(int deviceId)
    Creates a DeviceInformation for a device on the default CAN bus.
    DeviceInformation(int deviceId, CANBus canbus)
    Creates a DeviceInformation with a canbus.
    DeviceInformation(int id, String canbus)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructing DeviceInformation with a CAN bus string is deprecated for removal in the 2027 season.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the canbus that this device is on.
    boolean
     
    int
     
    int
    id()
    Gets the can id of this device

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeviceInformation

      public DeviceInformation(int deviceId)
      Creates a DeviceInformation for a device on the default CAN bus.
      Parameters:
      deviceId - the configured ID of the device
    • DeviceInformation

      public DeviceInformation(int deviceId, CANBus canbus)
      Creates a DeviceInformation with a canbus.
      Parameters:
      deviceId - the configured ID of the device
      canbus - the CAN bus the device is on
    • DeviceInformation

      @Deprecated(forRemoval=true) public DeviceInformation(int id, String canbus)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructing DeviceInformation with a CAN bus string is deprecated for removal in the 2027 season. Construct instances using a CANBus instance instead.
      Creates a DeviceInformation with a canbus string. If canbus is null, method acts like DeviceInformation(int) was called
      Parameters:
      id - the CAN id
      canbus - the name of the CAN bus the device is on
  • Method Details

    • id

      public int id()
      Gets the can id of this device
      Returns:
      the can id of the device
    • canbus

      @Deprecated(forRemoval=true) public Optional<String> canbus()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the canbus that this device is on, or Optional.empty() if it is on the RoboRIO can loop
      Returns:
      the canbus that the device is on
    • canBus

      public CANBus canBus()
      Returns the canbus that this device is on.
      Returns:
      the canbus that the device is on
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object