Class ComPortJNI

java.lang.Object
javaforce.jni.ComPortJNI
All Implemented Interfaces:
ComPortAPI

public class ComPortJNI extends Object implements ComPortAPI
  • Constructor Details

    • ComPortJNI

      public ComPortJNI()
  • Method Details

    • getInstance

      public static ComPortJNI getInstance()
    • comOpen

      public long comOpen(String name, int baud)
      Description copied from interface: ComPortAPI
      Opens a com port.
      Specified by:
      comOpen in interface ComPortAPI
      Parameters:
      name - = com port name (com1, com2, etc)
      baud - = baud rate (9600, 19200, 38400, 57600, 115200)
    • comRead

      public int comRead(long handle, byte[] data, int size)
      Description copied from interface: ComPortAPI
      Read data from Com Port (blocking)
      Specified by:
      comRead in interface ComPortAPI
    • comWrite

      public int comWrite(long handle, byte[] data, int size)
      Description copied from interface: ComPortAPI
      Writes data to Com Port
      Specified by:
      comWrite in interface ComPortAPI
    • comClose

      public void comClose(long handle)
      Description copied from interface: ComPortAPI
      Closes Com Port
      Specified by:
      comClose in interface ComPortAPI