SetRealPortLineControl

The SetRealPortLineControl method sets the line control register (LCR) for real serial port. The line control register controls the data size, the number of stopbits, as well as the parity.

VARIANT_BOOL SetRealPortLineControl(
LONG StopBits,
LONG Parity,// Parity
LONG DataBits// Data Bits
);

Parameters
StopBits[out] Number of stop bits to be used. Can have one of the following values:

ValueMeaning
01 stop bit
11.5 stop bits
22 stop bits

Parity[out] Parity scheme to be used. Can have one of the following values:

ValueMeaning
0No parity
1Odd
2Even
3Mark
4Space

DataBits [out] Number of bits in bytes transmitted and received.

Return Values
If the function succeeds, the return value is TRUE, otherwise FALSE.

Remarks
You can set this method forcibly, without waiting for events.