T - public abstract class IrSerial<T extends LocalSerialPort> extends Object implements IHarcHardware
| Modifier and Type | Field and Description |
|---|---|
protected T |
serialPort |
protected boolean |
verbose |
| Constructor and Description |
|---|
IrSerial(Class<T> clazz,
String portName,
int baudRate,
int dataSize,
int stopBits,
LocalSerialPort.Parity parity,
LocalSerialPort.FlowControl flowControl,
int timeout,
boolean verbose) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Transmitter |
getTransmitter() |
String |
getVersion()
Returns the hardware version (not the version of the driver software).
|
boolean |
isValid()
Tries to identify instances that are not valid.
|
void |
open()
Opens the device with previously set parameters.
|
void |
setBaudRate(int baudRate) |
void |
setDataSize(int dataSize) |
void |
setFlowControl(LocalSerialPort.FlowControl flowControl) |
void |
setParity(LocalSerialPort.Parity parity) |
void |
setPortName(String portName) |
void |
setStopBits(int stopBits) |
void |
setTimeout(int timeout)
Set timeout in milliseconds.
|
void |
setVerbose(boolean verbose)
Sets a verbosity flag, causing commands to be executed verbosely.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetDebugprotected boolean verbose
protected T extends LocalSerialPort serialPort
public IrSerial(Class<T> clazz, String portName, int baudRate, int dataSize, int stopBits, LocalSerialPort.Parity parity, LocalSerialPort.FlowControl flowControl, int timeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic void setBaudRate(int baudRate)
baudRate - the baudRate to setpublic void setDataSize(int dataSize)
dataSize - the dataSize to setpublic void setStopBits(int stopBits)
stopBits - the stopBits to setpublic void setParity(LocalSerialPort.Parity parity)
parity - the parity to setpublic void setFlowControl(LocalSerialPort.FlowControl flowControl)
flowControl - the flowControl to setpublic void setPortName(String portName)
portName - the portName to setpublic String getVersion() throws IOException
IHarcHardwaregetVersion in interface IHarcHardwareIOExceptionpublic void setVerbose(boolean verbose)
IHarcHardwaresetVerbose in interface IHarcHardwareverbose - on or offpublic void setTimeout(int timeout)
throws IOException
IHarcHardwaresetTimeout in interface IHarcHardwaretimeout - Timeout in milliseconds.IOExceptionpublic boolean isValid()
IHarcHardwareisValid in interface IHarcHardwarepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic Transmitter getTransmitter()
public void open()
throws HarcHardwareException,
IOException
IHarcHardwareopen in interface IHarcHardwareHarcHardwareExceptionIOExceptionCopyright © 2020. All rights reserved.