Record Class CANBusId
java.lang.Object
java.lang.Record
xbot.common.injection.electrical_contract.CANBusId
- Record Components:
id- Bus name string
Represents a CAN bus ID. Use
fromPort(CANPort) for native SystemCore and MotionCore ports; CANivore retains
its wildcard identity.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static CANBusIdfromPort(org.wpilib.hardware.bus.CANPort port) Describes a native bus using WPILib's port enum and Phoenix's corresponding bus name.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Converts this CANBusId to a Phoenix CANBus object.final StringtoString()Returns a string representation of this record class.org.wpilib.hardware.bus.CANPortConverts this CANBusId to a WPILib CANPort.
-
Field Details
-
Canivore
-
-
Constructor Details
-
CANBusId
-
-
Method Details
-
fromPort
Describes a native bus using WPILib's port enum and Phoenix's corresponding bus name. A null port produces an invalid address request for DevicePolice to reject. -
toPhoenixCANBus
Converts this CANBusId to a Phoenix CANBus object. Unsupported identities are logged and fall back to SystemCore CAN_S0.- Returns:
- Corresponding CANBus object
-
toWpiCANPort
public org.wpilib.hardware.bus.CANPort toWpiCANPort()Converts this CANBusId to a WPILib CANPort. Non-native identities (including CANivore) are logged and fall back to SystemCore CAN_S0.- Returns:
- Corresponding CANPort
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
-