|
function TCommPortDriver.GetLineStatus: TLineStatusSet;
var dwS: DWORD;
begin
Result := [];
if not Connected then
exit;
// Retrieves modem control-register values.
// The function fails if the hardware does not support the control-register
// values.
if not GetCommModemStatus( FHandle, dwS ) then
exit;
if dwS and MS_CTS_ON <> 0 then Result := Result + [lsCTS];
if dwS and MS_DSR_ON <> 0 then Result := Result + [lsDSR];
if dwS and MS_RING_ON <> 0 then Result := Result + [lsRING];
if dwS and MS_RLSD_ON <> 0 then Result := Result + [lsCD];
end;