Serial Port Communication in Java

Sometimes, we need to deal with hardware or external devices from a Java application. One of the options how to communicate with them is to use the COM port (also known as serial port inteface) of the PC. Serial port is not only allows you a direct cable connection via physical ports, but it can also establish a connection via virtual ports for Bluetooth, Wi-Fi devices, and etc.

Java applications are executed in Java Virtual Machine (JVM), therefore, they have not direct access to individual memory address and can not communicate directly with any hardware devices. In contrast, C/C++ programming languages allow you to directly access memory address and thereby access to the hardware. What about the use of the C feature to communication with hardware and then call created C functions from Java?

Continue reading