001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2016-2017. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj.can;
009
010import java.nio.ByteBuffer;
011import java.nio.IntBuffer;
012
013import edu.wpi.first.wpilibj.hal.JNIWrapper;
014
015@SuppressWarnings("AbbreviationAsWordInName")
016public class CANJNI extends JNIWrapper {
017  public static final int CAN_SEND_PERIOD_NO_REPEAT = 0;
018  public static final int CAN_SEND_PERIOD_STOP_REPEATING = -1;
019
020  /* Flags in the upper bits of the messageID */
021  public static final int CAN_IS_FRAME_REMOTE = 0x80000000;
022  public static final int CAN_IS_FRAME_11BIT = 0x40000000;
023
024  @SuppressWarnings("MethodName")
025  public static native void FRCNetCommCANSessionMuxSendMessage(int messageID,
026                                                                            ByteBuffer data,
027                                                                            int periodMs);
028
029  @SuppressWarnings("MethodName")
030  public static native ByteBuffer FRCNetCommCANSessionMuxReceiveMessage(
031      IntBuffer messageID, int messageIDMask, ByteBuffer timeStamp);
032}