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 CANStreamMessage {
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  @SuppressWarnings("MemberName")
018  public int messageID;
019
020  /**
021   * API used from JNI to set the data.
022   *
023   * @param length Length of packet in bytes.
024   * @param messageID CAN message ID of the message.
025   * @param timestamp CAN frame timestamp in microseconds.
026   * @return Buffer containing CAN frame.
027   */
028  @SuppressWarnings("PMD.MethodReturnsInternalArray")
029  public byte[] setStreamData(int length, int messageID, long timestamp) {
030    this.messageID = messageID;
031    this.length = length;
032    this.timestamp = timestamp;
033    return data;
034  }
035}