001/*----------------------------------------------------------------------------*/ 002/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */ 003/* Open Source Software - may be modified and shared by FRC teams. The code */ 004/* must be accompanied by the FIRST BSD license file in the root directory of */ 005/* the project. */ 006/*----------------------------------------------------------------------------*/ 007 008package edu.wpi.first.wpilibj.can; 009 010/** 011 * Structure for holding the result of a CAN Status request. 012 */ 013public class CANStatus { 014 /** 015 * The utilization of the CAN Bus. 016 */ 017 @SuppressWarnings("MemberName") 018 public double percentBusUtilization; 019 020 /** 021 * The CAN Bus off count. 022 */ 023 @SuppressWarnings("MemberName") 024 public int busOffCount; 025 026 /** 027 * The CAN Bus TX full count. 028 */ 029 @SuppressWarnings("MemberName") 030 public int txFullCount; 031 032 /** 033 * The CAN Bus receive error count. 034 */ 035 @SuppressWarnings("MemberName") 036 public int receiveErrorCount; 037 038 /** 039 * The CAN Bus transmit error count. 040 */ 041 @SuppressWarnings("MemberName") 042 public int transmitErrorCount; 043 044 @SuppressWarnings("JavadocMethod") 045 public void setStatus(double percentBusUtilization, int busOffCount, int txFullCount, 046 int receiveErrorCount, int transmitErrorCount) { 047 this.percentBusUtilization = percentBusUtilization; 048 this.busOffCount = busOffCount; 049 this.txFullCount = txFullCount; 050 this.receiveErrorCount = receiveErrorCount; 051 this.transmitErrorCount = transmitErrorCount; 052 } 053}