This function assumes that
COMMTSR.EXE is loaded and that COMMDRV.DRV is installed in
the CONFIG.SYS file. The IOCTL$(1) call assumes the communication port
was opened as in the example that ships with the product.
The following function returns the Modem
Status Register which contains the Clear To Send, Data Set Register,
Ring Indicator, and Carrier Detect. 'AND' with the following
constants to determine the signal that is active.
| 16 - |
For Clear To Send |
| 32 - |
For Data Set Ready |
| 64 - |
For Ring Indicator |
| 128 - |
For Data Carrier Detect
|
'************************************************************
'*=====GetMSR()
*
'*
*
'*Description-
*
'* Returns the amount of data that may be
written to *
'* the serial port.
*
'*
*
'*Syntax-
*
'* MSR% = GetMSR%
*
'*
*
'*On Entry-
*
'*
*
'*On Exit-
*
'* Modem status.
*
'************************************************************
FUNCTION GetMSR%
pcb$ = SPACE$(124)
pcb$ = IOCTL$(1)
GetMSR% = ASC(MID$(pcb$, 69, 1))
END FUNCTION
|