Class CANStreamMessage

java.lang.Object
edu.wpi.first.hal.can.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 flags of the message.
    int
    The length of the data received (0-64 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 flags, 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-64 bytes).
    • flags

      public int flags
      The flags of the message.
    • 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 flags, 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.
      flags - Message flags.
      timestamp - CAN frame timestamp in microseconds.
      Returns:
      Buffer containing CAN frame.