- java.lang.Object
-
- java.nio.channels.spi.AbstractInterruptibleChannel
-
- de.ibapl.spsw.jniprovider.AbstractSerialPortSocket<GenericWinSerialPortSocket>
-
- de.ibapl.spsw.jniprovider.GenericWinSerialPortSocket
-
- All Implemented Interfaces:
SerialPortConfiguration,SerialPortSocket,Closeable,AutoCloseable,ByteChannel,Channel,InterruptibleChannel,ReadableByteChannel,WritableByteChannel
public class GenericWinSerialPortSocket extends AbstractSerialPortSocket<GenericWinSerialPortSocket>
/** JNI wrapper around the Windows DCB structure.- Author:
- scream3r, Arne Plöse
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.ibapl.spsw.jniprovider.AbstractSerialPortSocket
AbstractSerialPortSocket.SerialInputStream, AbstractSerialPortSocket.SerialOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description static CleanerCLEANER-
Fields inherited from class de.ibapl.spsw.jniprovider.AbstractSerialPortSocket
is, os
-
Fields inherited from interface de.ibapl.spsw.api.SerialPortConfiguration
INFINITE_TIMEOUT, PORT_FD_INVALID, PORT_IS_CLOSED, PORT_IS_OPEN
-
-
Constructor Summary
Constructors Constructor Description GenericWinSerialPortSocket(String portName)GenericWinSerialPortSocket(String portName, Speed speed, DataBits dataBits, StopBits stopBits, Parity parity, Set<FlowControl> flowControls)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclose0()Close portvoiddrainOutputBuffer()intgetInterByteReadTimeout()intgetOverallReadTimeout()intgetOverallWriteTimeout()protected voidimplCloseChannel()protected voidopen(String portName, int paramBitSet)Open portvoidsendXOFF()voidsendXON()voidsetTimeouts(int interbyteReadTimeout, int overallReadTimeout, int overallWriteTimeout)-
Methods inherited from class de.ibapl.spsw.jniprovider.AbstractSerialPortSocket
ensureOpen, getDatatBits, getFlowControl, getInBufferBytesCount, getInputStream, getOutBufferBytesCount, getOutputStream, getParameters, getParity, getPortName, getSpeed, getStopBits, getXOFFChar, getXONChar, isCTS, isDCD, isDSR, isRI, open, read, sendBreak, setBreak, setDataBits, setDTR, setFlowControl, setParameters, setParity, setRTS, setSpeed, setStopBits, setXOFFChar, setXONChar, toString, write, writeBytes_ParamsOK, writeSingle
-
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.nio.channels.InterruptibleChannel
close
-
Methods inherited from interface de.ibapl.spsw.api.SerialPortConfiguration
calculateMillisForCharacters, calculateMillisPerCharacter, calculateSpeedInCharactersPerSecond
-
-
-
-
Field Detail
-
CLEANER
public static final Cleaner CLEANER
-
-
Constructor Detail
-
GenericWinSerialPortSocket
public GenericWinSerialPortSocket(String portName) throws IOException
- Throws:
IOException
-
GenericWinSerialPortSocket
public GenericWinSerialPortSocket(String portName, Speed speed, DataBits dataBits, StopBits stopBits, Parity parity, Set<FlowControl> flowControls) throws IOException
- Throws:
IOException
-
-
Method Detail
-
implCloseChannel
protected void implCloseChannel() throws IOException- Overrides:
implCloseChannelin classAbstractSerialPortSocket<GenericWinSerialPortSocket>- Throws:
IOException
-
close0
protected void close0() throws IOExceptionClose port- Throws:
IOException
-
open
protected void open(String portName, int paramBitSet) throws IOException
Description copied from class:AbstractSerialPortSocketOpen port- Specified by:
openin classAbstractSerialPortSocket<GenericWinSerialPortSocket>- Parameters:
portName- the name of port for openingparamBitSet- the parameters as masked bit set.- Throws:
IOException
-
drainOutputBuffer
public void drainOutputBuffer() throws IOException- Throws:
IOException
-
getInterByteReadTimeout
public int getInterByteReadTimeout() throws IOException- Throws:
IOException
-
getOverallReadTimeout
public int getOverallReadTimeout() throws IOException- Throws:
IOException
-
getOverallWriteTimeout
public int getOverallWriteTimeout() throws IOException- Throws:
IOException
-
sendXOFF
public void sendXOFF() throws IOException- Throws:
IOException
-
sendXON
public void sendXON() throws IOException- Throws:
IOException
-
setTimeouts
public void setTimeouts(int interbyteReadTimeout, int overallReadTimeout, int overallWriteTimeout) throws IOException- Throws:
IOException
-
-