Function Com_LSR() Foundation

Reads the Line Status Register.

Syntax
Com_LSR( <nComPortNum> ;
       ) --> nLSR
Return

Com_LSR() returns the contents of the Line Status Register as a numeric value. The function IsBit() must be used to detect which bits are set.

Description

#define constants to be used for IsBit() are found in XBTCOM.CH

Bits set in Com_LSR() return value
Bit Constant Description
No bit set LSR_ERROR something went wrong or LSR = 0
Bit 1 set LSR_DATA_READY there is data in the transmit buffer
Bit 2 set LSR_OVERRUN_ERR buffer overflow or overflow in UART
Bit 3 set LSR_PARITY_ERR UART detected a parity error
Bit 4 set LSR_FRAMING_ERR UART detected a framing error
Bit 5 set LSR_BREAK set if BREAK has been detected
All other bits will be set to 0:
LSR_TRANS_HOLD_EMPTY not supported
LSR_TRANS_EMPTY not supported

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.