Class CANStreamMessage

java.lang.Object
edu.wpi.first.hal.CANStreamMessage

public class CANStreamMessage extends Object
Represents a CAN message read from a stream.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final byte[]
    The message data.
    int
    The length of the data received (0-8 bytes).
    int
    The message ID.
    long
    Timestamp message was received, in milliseconds (based off of CLOCK_MONOTONIC).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    setStreamData(int length, int messageID, long timestamp)
    API used from JNI to set the data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • data

      public final byte[] data
      The message data.
    • length

      public int length
      The length of the data received (0-8 bytes).
    • timestamp

      public long timestamp
      Timestamp message was received, in milliseconds (based off of CLOCK_MONOTONIC).
    • messageID

      public int messageID
      The message ID.
  • Constructor Details

  • Method Details

    • setStreamData

      public byte[] setStreamData(int length, int messageID, long timestamp)
      API used from JNI to set the data.
      Parameters:
      length - Length of packet in bytes.
      messageID - CAN message ID of the message.
      timestamp - CAN frame timestamp in microseconds.
      Returns:
      Buffer containing CAN frame.