mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Use OS for serial port instead of NI VISA (#1875)
This commit is contained in:
committed by
Peter Johnson
parent
b23baf611a
commit
9f740e5905
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -8,41 +8,41 @@
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
public class SerialPortJNI extends JNIWrapper {
|
||||
public static native void serialInitializePort(byte port);
|
||||
public static native int serialInitializePort(byte port);
|
||||
|
||||
public static native void serialInitializePortDirect(byte port, String portName);
|
||||
public static native int serialInitializePortDirect(byte port, String portName);
|
||||
|
||||
public static native void serialSetBaudRate(byte port, int baud);
|
||||
public static native void serialSetBaudRate(int handle, int baud);
|
||||
|
||||
public static native void serialSetDataBits(byte port, byte bits);
|
||||
public static native void serialSetDataBits(int handle, byte bits);
|
||||
|
||||
public static native void serialSetParity(byte port, byte parity);
|
||||
public static native void serialSetParity(int handle, byte parity);
|
||||
|
||||
public static native void serialSetStopBits(byte port, byte stopBits);
|
||||
public static native void serialSetStopBits(int handle, byte stopBits);
|
||||
|
||||
public static native void serialSetWriteMode(byte port, byte mode);
|
||||
public static native void serialSetWriteMode(int handle, byte mode);
|
||||
|
||||
public static native void serialSetFlowControl(byte port, byte flow);
|
||||
public static native void serialSetFlowControl(int handle, byte flow);
|
||||
|
||||
public static native void serialSetTimeout(byte port, double timeout);
|
||||
public static native void serialSetTimeout(int handle, double timeout);
|
||||
|
||||
public static native void serialEnableTermination(byte port, char terminator);
|
||||
public static native void serialEnableTermination(int handle, char terminator);
|
||||
|
||||
public static native void serialDisableTermination(byte port);
|
||||
public static native void serialDisableTermination(int handle);
|
||||
|
||||
public static native void serialSetReadBufferSize(byte port, int size);
|
||||
public static native void serialSetReadBufferSize(int handle, int size);
|
||||
|
||||
public static native void serialSetWriteBufferSize(byte port, int size);
|
||||
public static native void serialSetWriteBufferSize(int handle, int size);
|
||||
|
||||
public static native int serialGetBytesReceived(byte port);
|
||||
public static native int serialGetBytesReceived(int handle);
|
||||
|
||||
public static native int serialRead(byte port, byte[] buffer, int count);
|
||||
public static native int serialRead(int handle, byte[] buffer, int count);
|
||||
|
||||
public static native int serialWrite(byte port, byte[] buffer, int count);
|
||||
public static native int serialWrite(int handle, byte[] buffer, int count);
|
||||
|
||||
public static native void serialFlush(byte port);
|
||||
public static native void serialFlush(int handle);
|
||||
|
||||
public static native void serialClear(byte port);
|
||||
public static native void serialClear(int handle);
|
||||
|
||||
public static native void serialClose(byte port);
|
||||
public static native void serialClose(int handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user