public final class LocalSerialPortBuffered extends LocalSerialPort implements ICommandLineDevice
LocalSerialPort.FlowControl, LocalSerialPort.ParitydefaultPort, inStream, outStream, verbose| Constructor and Description |
|---|
LocalSerialPortBuffered(int portNumber) |
LocalSerialPortBuffered(String portName) |
LocalSerialPortBuffered(String portName,
int baud,
boolean verbose) |
LocalSerialPortBuffered(String portName,
int baud,
int timeout,
boolean verbose) |
LocalSerialPortBuffered(String portName,
int baud,
int length,
int stopBits,
LocalSerialPort.Parity parity,
LocalSerialPort.FlowControl flowControl,
int timeout,
boolean verbose) |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args) |
void |
open()
Opens the device.
|
String |
readString()
Reads a line of text.
|
String |
readString(boolean wait)
Reads a line of text.
|
boolean |
ready()
Tells whether this stream is ready to be read.
|
void |
sendByte(byte b) |
void |
sendBytes(byte[] data) |
void |
sendBytes(byte[] data,
int offset,
int length) |
void |
sendString(String cmd)
Sends a command (a String) to the instance.
|
void |
setDebug(int debug)
Sets a debug parameter.
|
close, dropDTR, flush, flushInput, getPortName, getSerialPortName, getSerialPortNames, getVersion, isValid, setDTR, setTimeout, setVerbosityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitflushInputgetVersion, isValid, setTimeout, setVerbositypublic LocalSerialPortBuffered(String portName, int baud, int length, int stopBits, LocalSerialPort.Parity parity, LocalSerialPort.FlowControl flowControl, int timeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public LocalSerialPortBuffered(String portName, int baud, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public LocalSerialPortBuffered(String portName, int baud, int timeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public LocalSerialPortBuffered(String portName) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public LocalSerialPortBuffered(int portNumber)
throws IOException,
NoSuchPortException,
PortInUseException,
UnsupportedCommOperationException
public static void main(String[] args)
public void open()
throws HarcHardwareException,
IOException
LocalSerialPortopen in interface IHarcHardwareopen in class LocalSerialPortHarcHardwareException - Bundles RXTX exceptions together.IOExceptionpublic void sendString(String cmd) throws IOException
ICommandLineDevicesendString in interface ICommandLineDevicecmd - Command string to be sent.IOExceptionpublic void sendBytes(byte[] data)
throws IOException
IOExceptionpublic void sendBytes(byte[] data,
int offset,
int length)
throws IOException
IOExceptionpublic void sendByte(byte b)
throws IOException
IOExceptionpublic String readString() throws IOException
ICommandLineDevicereadString in interface ICommandLineDeviceIOExceptionpublic String readString(boolean wait) throws IOException
ICommandLineDevicereadString in interface ICommandLineDevicewait - if true, wait until something arrives, otherwise return null if nothing there.IOExceptionpublic boolean ready()
throws IOException
ICommandLineDeviceready in interface ICommandLineDeviceIOException - If an I/O error occurspublic void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardwareCopyright © 2016. All rights reserved.