Package com.celer
Class COM
java.lang.Object
com.celer.COM
public class COM
extends java.lang.Object
- 
Method SummaryModifier and Type Method Description voidclose()Close the COM port.COMInputStreamgetInputStream()Get an input stream, which can be used to read from this COM port.COMOutputStreamgetOutputStream()Get an output stream, which can be used to write to this COM port.booleanisNative()Test if the COM driver is native or Java (RAF).static COMopen(java.lang.String comdev)Open the COM port.
- 
Method Details- 
openOpen the COM port.- Parameters:
- comdev- specifies the name of the COM port.- In Windows the COM port names must start with "\\.\" if the port number is greater than 9, for example: - COM9 \\.\COM15 Note: Don't forget to escape the backslash character in Java!- In Linux a typical COM port name can be: - /dev/ttyUSB1 
- Returns:
- The COM port instance, which can be used to read, write or close the port.
- Throws:
- java.lang.IllegalArgumentException- if the COM port name is null or empty.
- java.io.IOException- if the port can't be opened. This can happen if the device is not connected.
 
- 
getInputStreamGet an input stream, which can be used to read from this COM port.- Returns:
- The input stream. This stream is released implicitly when the COM port is closed by calling the close()method.
 
- 
getOutputStreamGet an output stream, which can be used to write to this COM port.- Returns:
- The output stream. This stream is released implicitly when the COM port is closed by calling the close()method.
 
- 
closepublic void close()Close the COM port. Call this method to free the resources and streams. After closing the COM port any read or write operation will fail. It is recommended to close the COM port when it is no longer needed.
- 
isNativepublic boolean isNative()Test if the COM driver is native or Java (RAF).- Returns:
- If the driver is native returns true. Otherwise returnsfalse.
 
 
- 
