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("AbbreviationAsWordInName")
008public class CANAPIJNI extends JNIWrapper {
009  public static native int initializeCAN(int manufacturer, int deviceId, int deviceType);
010
011  public static native void cleanCAN(int handle);
012
013  public static native void writeCANPacket(int handle, byte[] data, int apiId);
014
015  public static native void writeCANPacketRepeating(
016      int handle, byte[] data, int apiId, int repeatMs);
017
018  public static native void writeCANRTRFrame(int handle, int length, int apiId);
019
020  public static native int writeCANPacketNoThrow(int handle, byte[] data, int apiId);
021
022  public static native int writeCANPacketRepeatingNoThrow(
023      int handle, byte[] data, int apiId, int repeatMs);
024
025  public static native int writeCANRTRFrameNoThrow(int handle, int length, int apiId);
026
027  public static native void stopCANPacketRepeating(int handle, int apiId);
028
029  public static native boolean readCANPacketNew(int handle, int apiId, CANData data);
030
031  public static native boolean readCANPacketLatest(int handle, int apiId, CANData data);
032
033  public static native boolean readCANPacketTimeout(
034      int handle, int apiId, int timeoutMs, CANData data);
035}