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