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.can;
006
007import edu.wpi.first.hal.JNIWrapper;
008import java.nio.ByteBuffer;
009import java.nio.IntBuffer;
010
011@SuppressWarnings("AbbreviationAsWordInName")
012public class CANJNI extends JNIWrapper {
013  public static final int CAN_SEND_PERIOD_NO_REPEAT = 0;
014  public static final int CAN_SEND_PERIOD_STOP_REPEATING = -1;
015
016  /* Flags in the upper bits of the messageID */
017  public static final int CAN_IS_FRAME_REMOTE = 0x80000000;
018  public static final int CAN_IS_FRAME_11BIT = 0x40000000;
019
020  @SuppressWarnings("MethodName")
021  public static native void FRCNetCommCANSessionMuxSendMessage(
022      int messageID, byte[] data, int periodMs);
023
024  @SuppressWarnings("MethodName")
025  public static native byte[] FRCNetCommCANSessionMuxReceiveMessage(
026      IntBuffer messageID, int messageIDMask, ByteBuffer timeStamp);
027
028  @SuppressWarnings("MethodName")
029  public static native void getCANStatus(CANStatus status);
030}