001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal.can;
006
007/** Structure for holding the result of a CAN Status request. */
008public class CANStatus {
009  /** The utilization of the CAN Bus. */
010  @SuppressWarnings("MemberName")
011  public double percentBusUtilization;
012
013  /** The CAN Bus off count. */
014  @SuppressWarnings("MemberName")
015  public int busOffCount;
016
017  /** The CAN Bus TX full count. */
018  @SuppressWarnings("MemberName")
019  public int txFullCount;
020
021  /** The CAN Bus receive error count. */
022  @SuppressWarnings("MemberName")
023  public int receiveErrorCount;
024
025  /** The CAN Bus transmit error count. */
026  @SuppressWarnings("MemberName")
027  public int transmitErrorCount;
028
029  @SuppressWarnings("MissingJavadocMethod")
030  public void setStatus(
031      double percentBusUtilization,
032      int busOffCount,
033      int txFullCount,
034      int receiveErrorCount,
035      int transmitErrorCount) {
036    this.percentBusUtilization = percentBusUtilization;
037    this.busOffCount = busOffCount;
038    this.txFullCount = txFullCount;
039    this.receiveErrorCount = receiveErrorCount;
040    this.transmitErrorCount = transmitErrorCount;
041  }
042}