public final class LocalSerialPortBuffered extends LocalSerialPort implements ICommandLineDevice
LocalSerialPort.FlowControl, LocalSerialPort.Parity
defaultPort, 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, setVerbosity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
flushInput
getVersion, isValid, setTimeout, setVerbosity
public 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
LocalSerialPort
open
in interface IHarcHardware
open
in class LocalSerialPort
HarcHardwareException
- Bundles RXTX exceptions together.IOException
public void sendString(String cmd) throws IOException
ICommandLineDevice
sendString
in interface ICommandLineDevice
cmd
- Command string to be sent.IOException
public void sendBytes(byte[] data) throws IOException
IOException
public void sendBytes(byte[] data, int offset, int length) throws IOException
IOException
public void sendByte(byte b) throws IOException
IOException
public String readString() throws IOException
ICommandLineDevice
readString
in interface ICommandLineDevice
IOException
public String readString(boolean wait) throws IOException
ICommandLineDevice
readString
in interface ICommandLineDevice
wait
- if true, wait until something arrives, otherwise return null if nothing there.IOException
public boolean ready() throws IOException
ICommandLineDevice
ready
in interface ICommandLineDevice
IOException
- If an I/O error occurspublic void setDebug(int debug)
IHarcHardware
setDebug
in interface IHarcHardware
Copyright © 2016. All rights reserved.