Constructor and Description |
---|
FCOCPortSerial(java.lang.String szComPort,
int nBaudRate)
Create a new serial port
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Get number of available bytes in receive buffer
|
void |
close()
Ask to close the communication port
|
void |
discardInputBuffer()
Discards data from the receive buffer.
|
int |
getBaudRate() |
java.lang.String |
getComPort() |
int |
getData(byte[] acBuffer,
int nOffset,
int nLength)
Get data from the communication port
|
int |
getData(byte[] acBuffer,
int nOffset,
int nLength,
int nTimeout)
Get data from the communication port
|
com.fivecolibs.devices.FCOEPortState |
getState() |
void |
open()
Ask to open the communication port
|
void |
putData(byte[] acBuffer,
int nOffset,
int nLength)
Send data through the communication port
|
public FCOCPortSerial(java.lang.String szComPort, int nBaudRate)
szComPort
- Serial communication portnBaudRate
- Baud rate (real value)public java.lang.String getComPort()
public int getBaudRate()
public com.fivecolibs.devices.FCOEPortState getState()
public void open() throws java.io.IOException
FCOIPort
public void close()
FCOIPort
public void putData(byte[] acBuffer, int nOffset, int nLength) throws java.io.IOException
FCOIPort
putData
in interface FCOIPort
acBuffer
- The buffer of data to outputnOffset
- The offset in the buffer where data will be sent fromnLength
- The length of data that will be sent beginning at the offsetjava.io.IOException
- If an exception occurs in the underlying communication systempublic int getData(byte[] acBuffer, int nOffset, int nLength) throws java.io.IOException
FCOIPort
getData
in interface FCOIPort
acBuffer
- Buffer where data will be put when readnOffset
- The offset in the buffer where data will be putnLength
- The maximum length of data requested to be put in the bufferjava.io.IOException
- If an exception occurs in the underlying communication systempublic int getData(byte[] acBuffer, int nOffset, int nLength, int nTimeout) throws java.io.IOException
FCOIPort
getData
in interface FCOIPort
acBuffer
- Buffer where data will be put when readnOffset
- The offset in the buffer where data will be putnLength
- The maximum length of data requested to be put in the buffernTimeout
- The time in millisecond to wait if the nLength is not reached.java.io.IOException
- If an exception occurs in the underlying communication systempublic void discardInputBuffer()
FCOIPort
discardInputBuffer
in interface FCOIPort