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; 006 007public class CANData { 008 @SuppressWarnings("MemberName") 009 public final byte[] data = new byte[8]; 010 011 @SuppressWarnings("MemberName") 012 public int length; 013 014 @SuppressWarnings("MemberName") 015 public long timestamp; 016 017 /** 018 * API used from JNI to set the data. 019 * 020 * @param length Length of packet in bytes. 021 * @param timestamp CAN frame timestamp in microseconds. 022 * @return Buffer containing CAN frame. 023 */ 024 @SuppressWarnings("PMD.MethodReturnsInternalArray") 025 public byte[] setData(int length, long timestamp) { 026 this.length = length; 027 this.timestamp = timestamp; 028 return data; 029 } 030}