Constructor and Description |
---|
FCOCPortUDP(java.lang.String szIPAddress)
Connect to legacy standard port 8010
|
FCOCPortUDP(java.lang.String szIPAddress,
int nUDPPort)
Connect to a defined UDP 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 |
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
|
java.lang.String |
getIPAddress() |
com.fivecolibs.devices.FCOEPortState |
getState() |
int |
getUDPPort() |
void |
open()
Ask to open the communication port
|
void |
putData(byte[] acBuffer,
int nOffset,
int nLength)
Send data through the communication port
|
public FCOCPortUDP(java.lang.String szIPAddress, int nUDPPort)
szIPAddress
- IP address of the device to connect to.nUDPPort
- UDP port to final connect topublic FCOCPortUDP(java.lang.String szIPAddress)
szIPAddress
- IP address of the device to connect to.public java.lang.String getIPAddress()
public int getUDPPort()
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