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