The most obvious issue is that the interface in Listing 6 requires a JNI call for each bit set or retrieved, as well as a JNI call to read a byte from, or write a byte to, the serialport.
Mode of serialport pair: synchronous clock device through the serialportread per second pair a serial output time information, serial port and RS232 interface and RS422 interface.