public class SerialPort
extends java.lang.Object
SerialPort
is a simple wrapper around some native code that give us access to serial ports.Modifier and Type | Field and Description |
---|---|
protected int |
baudRate |
protected java.io.File |
file |
protected java.io.FileDescriptor |
fileDescriptor |
protected java.io.FileInputStream |
fileInputStream |
protected java.io.FileOutputStream |
fileOutputStream |
protected static java.lang.String |
TAG |
Constructor and Description |
---|
SerialPort(java.io.File file,
int baudRate) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static void |
close(java.io.FileDescriptor fileDescriptor) |
protected static void |
ensureReadWriteable(java.io.File file)
Attempts to ensure that the indicated file is read-write.
|
protected void |
finalize() |
int |
getBaudRate() |
java.io.InputStream |
getInputStream() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream() |
protected static final java.lang.String TAG
protected java.io.File file
protected java.io.FileDescriptor fileDescriptor
protected java.io.FileInputStream fileInputStream
protected java.io.FileOutputStream fileOutputStream
protected int baudRate
public SerialPort(java.io.File file, int baudRate) throws java.io.IOException
java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void close()
protected static void ensureReadWriteable(java.io.File file) throws java.lang.SecurityException
file
- the file who's properties we're interested injava.lang.SecurityException
- if the file cannot be made read-writepublic java.lang.String getName()
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public int getBaudRate()
public static void close(java.io.FileDescriptor fileDescriptor)