Package com.celer
CelerCOM is a Java library featuring connectivity with external devices through COM ports, for example: USB, virtual COM.
Reading from and writing to a COM port is implemented through the standard Java InputStream and OutputStream interfaces respectively.
CelerCOM uses a native JNI driver for the following Operating Systems (OS) and CPU architectures:
Windows | Linux | |
---|---|---|
x86 (32 bit) | ✓ | ✓ |
AMD64 (64 bit) | ✓ | ✓ |
ARM (32 bit) | ✓ |
For any other OS or architecture a pure Java implementaion is used, which is based on the RandomAccessFile (RAF) API. The RAF driver is also used as a fallback if the native driver is not available. The native driver is preferred:
- The native driver can recover from unexpected communication errors automatically.
- The ability to disable system cache for I/O operations, which is required for compatibility with some communication devices.
- Read operations block for 200ms at most when using the native driver. The RAF driver blocks indefinitely when waiting for the device.
-
Class Summary Class Description COM The COM class can be used to open and close a COM port, retrieve an input and output streams to perform I/O.COMInputStream The COM input stream can be used to read from a COM port.COMOutputStream The COM output stream can be used to write to a COM port.