| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Serial I/O {7 of 10} |
Function FindOpenPort(Env_str:Pchar): Boolean;
VAR
thfile:hfile;
tmp_dcb:dcbrec;
a:longint;
B_rec:ebrec;
tptr:pointer;
Value: Pchar;
status:byte;
retlength:longint;
BEGIN
FindOpenPort := false;
if Env_Strnil then BEGIN
FindOpenPort := ((DosScanEnv(Env_str,Value)=0) and (Value>nil));
if value nil then BEGIN
val(value,a,retlength);
if retlength=0 then Fport := a;
end;
exit;
end;
fillchar(tmp_dcb,sizeof(tmp_dcb),#0);
for thfile := 0 to 20 do BEGIN
tptr := {at}tmp_dcb;
DosDevIOCtl(thfile,1,$73,tptr,
sizeof(tmp_dcb),retlength,tptr,sizeof(tmp_dcb),retlength);
getdcb(tmp_dcb);
if ((tmp_dcb.Flag1 0) and
(tmp_dcb.Flag2 0) and
(tmp_dcb.Flag3 0)) then BEGIN
tptr := {at}b_rec;
DosDevIOCtl(thfile,1,$63,tptr,
sizeof(b_rec),retlength,tptr,sizeof(b_rec),retlength);
a := b_rec.c_baud;
if a>299 then BEGIN
Fport := thfile;
FindOpenPort := true;
exit;
end;
end;
end;
end;
Function RaiseDTR: Boolean;
VAR
maskrec:rts_dtr;
tptr:pointer;
retlength:longint;
BEGIN
if rtsactive then BEGIN
maskrec.Onmask := $3;
maskrec.Offmask := $FF;
end
else BEGIN
maskrec.Onmask := $1;
maskrec.Offmask := $FF;
end;
tptr := {at}maskrec;
DosDevIOCtl(Fport,1,$46,tptr,
sizeof(maskrec),retlength,tptr,sizeof(maskrec),retlength);
RaiseDTR := DTRActive;
end;
Function LowerDTR: Boolean;
VAR
maskrec:rts_dtr;
tptr:pointer;
retlength:longint;
BEGIN
if rtsactive then BEGIN
maskrec.Onmask := $2;
maskrec.Offmask := $FF;
end
else BEGIN
maskrec.Onmask := $0;
maskrec.Offmask := $FC;
end;
tptr := {at}maskrec;
DosDevIOCtl(Fport,1,$46,tptr,
sizeof(maskrec),retlength,tptr,sizeof(maskrec),retlength);
LowerDTR := not(DTRActive);
end;
Function RaiseRTS: Boolean;
VAR
maskrec:rts_dtr;
tptr:pointer;
retlength:longint;
BEGIN
if DTRactive then BEGIN
maskrec.Onmask := $3;
maskrec.Offmask := $FF;
end
else BEGIN
maskrec.Onmask := $2;
maskrec.Offmask := $FF;
end;
tptr := {at}maskrec;
DosDevIOCtl(Fport,1,$46,tptr,
___ Blue Wave/QWK v2.12
--- Renegade v10-05 Exp
* Origin: Scrawled From the Tomb..(416-255-2164) (1:250/346)SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407 SEEN-BY: 515 628 704 713/888 800/1 7877/2809 @PATH: 250/346 426 702 3615/50 396/1 270/101 105/103 42 712/515 711/808 @PATH: 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.