001/*
002 *  Software License Agreement
003 *
004 * Copyright (C) Cross The Road Electronics.  All rights
005 * reserved.
006 *
007 * Cross The Road Electronics (CTRE) licenses to you the right to
008 * use, publish, and distribute copies of CRF (Cross The Road) firmware files (*.crf) and Software
009 * API Libraries ONLY when in use with Cross The Road Electronics hardware products.
010 *
011 * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
012 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
013 * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A
014 * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
015 * CROSS THE ROAD ELECTRONICS BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
016 * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF
017 * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS
018 * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE
019 * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER
020 * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT
021 * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE
022 */
023package com.ctre.phoenix.platform.can;
024
025/**
026 * Configures the can interface for API
027 */
028public class PlatformCAN {
029    /**
030     * Set CAN interface
031     * @param canInterface Can interface to set, example "can0".
032     * @return ErrorCode generated by function
033     * @deprecated pass the CAN interface to device constructors instead,
034     *             or call registerCANbus
035     */
036        @Deprecated
037    public static int setCANInterface(char[] canInterface) {
038        return registerCANbus(canInterface);
039    }
040    /**
041     * Registers a non-compliant CANbus
042     * @param canbus CANbus to register. Linux example: "can0".
043     * @return ErrorCode generated by function
044     */
045    public static int registerCANbus(char[] canbus) {
046        return PlatformCANJNI.JNI_RegisterCANbus(canbus);
047    }
048    /**
049     * Set Autocache state
050     * @param state state of autocache
051     */
052    public static void setAutocacheLevel(AutocacheState state){
053        PlatformCANJNI.JNI_SetAutocacheLevel(state.value);
054    }
055}