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.hal; 009 010import java.io.File; 011 012/** 013 * Base class for all JNI wrappers. 014 */ 015public class JNIWrapper { 016 static boolean libraryLoaded = false; 017 static File jniLibrary = null; 018 019 static { 020 try { 021 if (!libraryLoaded) { 022 System.loadLibrary("wpilibJavaJNI"); 023 libraryLoaded = true; 024 } 025 026 } catch (Exception ex) { 027 ex.printStackTrace(); 028 System.exit(1); 029 } 030 } 031 032 public static native int getPortWithModule(byte module, byte channel); 033 034 public static native int getPort(byte channel); 035}