TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Russell Coker
from: Peter Fitzsimmons
date: 1994-06-15 01:32:24
subject: Maximus Door

RC>    I am writing a Maximus door program, everything is 
 RC> working fine except that I don't know how to check for 
 RC> carrier detect.  Could you please tell me how to do


     APIRET rc;
     USHORT msr=0;
     ULONG ulpinout, uldinout;

     ulpinout=uldinout=0;
     rc = DosDevIOCtl(hfile, IOCTL_ASYNC, ASYNC_GETMODEMINPUT, NULL, 0,
         &ulpinout, &msr, sizeof(msr), &uldinout);

     if(rc || !(msr & DCD_ON))
         return(FALSE);
     else
         return(TRUE);

 RC> Maximus.  Also I would like to know how to change the 
 RC> state of the DTR line and read the state of the DSR 
 RC> line.

I wouldn't change the state of DTR (unless you actually want your door to
hangup).  You do this by using the ASYNC_GETDCBINFO/ASYNC_SETDCBINFO call. 
The easiest way to lower dtr is to close the port (but this would be rude
to Maximus).  Why do you want to change dtr?

DSR can be tested by using the above code with DSR_ON instead of DCD_ON.
Usually a program need not worry about this value,  as the device driver
does.


--- Maximus/2 2.01

* Origin: Beer bellies = great waist. (905)858-8488 (1:259/414)
SEEN-BY: 54/54 620/243 632/348 640/820 690/660 711/409 413 430 807 808 809
SEEN-BY: 711/934 712/353 623 713/888 800/1 2442/0
@PATH: 259/414 400 99 98 3615/50 229/2 2442/0 711/409 54/54 711/808 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™.