### About

To communicate through COM ports, a Serial Library is available.
Tutorial: https://www.b4x.com/android/forum/threads/jserial-library.34762/
The library supports devices COM ports as well as Virtual COM ports.
You should handle AStream_Error and AStream_Terminated events.
The library is based upon jSSC:
https://github.com/scream3r/java-simple-serial-connector/blob/2.8.0/src/java/jssc/SerialPort.java
To use fields or methods from this library, the JavaObject library is required.
Example setFlowControlMode
Java Code
public boolean setFlowControlMode(int mask) throws SerialPortException {
checkPortOpened("setFlowControlMode()");
return serialInterface.setFlowControlMode(portHandle, mask);
}
B4J Code
Private serial1 As Serial
serial1.Open(parameter
)
Dim jo As JavaObject = serial1
'FLOWCONTROL_XONXOFF_IN | FLOWCONTROL_XONXOFF_OUT
'Defined in the java class as
' public static final int FLOWCONTROL_XONXOFF_IN = 4;
' public static final int FLOWCONTROL_XONXOFF_OUT = 8;
jo.GetFieldJO("sp").RunMethod("setFlowControlMode", Array(Bit.Or(4, 8)))

Changed: , Category: Serial, File: T6C245M1773.htm, ID: 1773