RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
CANJNI.java
1// TODO - RobotCore - Modified
2
3// Copyright (c) FIRST and other WPILib contributors.
4// Open Source Software; you can modify and/or share it under the terms of
5// the WPILib BSD license file in the root directory of this project.
6
7package org.wpilib.hardware.hal.can;
8
9// import org.wpilib.hardware.hal.JNIWrapper;
10
16@SuppressWarnings("MethodName")
17public class CANJNI { //extends JNIWrapper {
18
19 public static void getCANStatus(int busId, CANStatus status) {
20 throw new UnsupportedOperationException("Unimplemented method 'getCANStatus'");
21 // TODO - Must fix
22 }
23
24
25
26
27// /** Flag for sending a CAN message once. */
28// public static final int CAN_SEND_PERIOD_NO_REPEAT = 0;
29
30// /** Flag for stopping periodic CAN message sends. */
31// public static final int CAN_SEND_PERIOD_STOP_REPEATING = -1;
32
33// /** Mask for "is frame remote" in message ID. */
34// public static final int CAN_IS_FRAME_REMOTE = 0x40000000;
35
36// /** Mask for "is frame 11 bits" in message ID. */
37// public static final int CAN_IS_FRAME_11BIT = 0x80000000;
38
39// /** Default constructor. */
40// public CANJNI() {}
41
42// /**
43// * Sends a CAN message.
44// *
45// * @param busId The bus ID.
46// * @param messageId The ID of the CAN message.
47// * @param data the data to send.
48// * @param dataLength the length of data to send
49// * @param flags the message flags
50// * @param periodMs The period in milliseconds at which to send the message, use {@link
51// * #CAN_SEND_PERIOD_NO_REPEAT} for a single send.
52// * @return send status, 0 on success.
53// */
54// public static native int sendMessage(
55// int busId, int messageId, byte[] data, int dataLength, int flags, int periodMs);
56
57// /**
58// * Receives a CAN message.
59// *
60// * @param busId The bus ID.
61// * @param messageId message id to look for.
62// * @param message The message.
63// * @return receive status, 0 on success.
64// */
65// public static native int receiveMessage(int busId, int messageId, CANReceiveMessage message);
66
67// /**
68// * Retrieves the current status of the CAN bus.
69// *
70// * @param busId The bus ID.
71// * @param status The CANStatus object to hold the retrieved status.
72// */
73// public static native void getCANStatus(int busId, CANStatus status);
74
75// /**
76// * Opens a new CAN stream session for receiving CAN messages with specified filters.
77// *
78// * @param busId The bus ID.
79// * @param messageId The CAN messageId to match against. The bits of the messageId are bitwise
80// * ANDed with the messageIDMask.
81// * @param messageIDMask The CAN messageIDMask is a bit-wise mask of bits in the messageId to match
82// * against. This allows matching against multiple frames. For example, providing an messageId
83// * of 0x2050001 and a mask of 0x1FFF003F would match all REV motor controller frames for a
84// * device with CAN ID 1. Providing a mask of 0x1FFFFFFF means that only the exact messageId
85// * will be matched. Providing a mask of 0 would match any frame of any type.
86// * @param maxMessages The maximum number of messages that can be buffered in the session.
87// * @return The handle to the opened CAN stream session.
88// */
89// public static native int openCANStreamSession(
90// int busId, int messageId, int messageIDMask, int maxMessages);
91
92// /**
93// * Closes a CAN stream session.
94// *
95// * @param sessionHandle The handle of the CAN stream session to be closed.
96// */
97// public static native void closeCANStreamSession(int sessionHandle);
98
99// /**
100// * Reads messages from a CAN stream session.
101// *
102// * @param sessionHandle The handle of the CAN stream session.
103// * @param messages An array to hold the CANStreamMessage objects (output parameter).
104// * @param messagesToRead The number of messages to read from the session.
105// * @return The number of messages read into the buffer
106// * @throws CANStreamOverflowException If the number of messages to read exceeds the capacity of
107// * the provided messages array.
108// */
109// public static native int readCANStreamSession(
110// int sessionHandle, CANStreamMessage[] messages, int messagesToRead)
111// throws CANStreamOverflowException;
112}