TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Joe Lerch
from: Phil Crown
date: 1995-12-31 12:41:00
subject: check for carrier

-=> Quoting Joe Lerch to All <=- 

 JL> I would like to querry the modem to detect the carrier, my
 JL> guess is I would use the functions listed in the category 1
 JL> DosDevIOCtl calls. However, the example listed confuses me.
 JL> Every time I try to put something together, all I get is
 JL> errors.

 JL> Could some one show me how use the function to check the
 JL> modem to see if a carrier is present?

I use BCOS2 C++ too, but program in C.  Here's my carrier detect function.

// --------------------------------------------------------------------

BOOL    Carrier(HFILE hf)
{
  USHORT    c;

  DosDevIOCtl(hf, IOCTL_ASYNC, ASYNC_GETMODEMINPUT,
                     NULL, 0, NULL, &c, sizeof(USHORT), NULL );
  if( c & 0x0080)
    return TRUE;
  return FALSE;
}

phil.crown{at}bluecafe.com
___ Blue Wave/OS2 v2.22b

--- WILDMAIL!/WC v4.12 
* Origin: The Blues Cafe (214) 638-1186 8 Nodes (1:124/8014.0)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 808 809 934 955 712/407 515
SEEN-BY: 712/517 628 713/888 800/1 7877/2809
@PATH: 124/8014 8001 1 396/1 270/101 712/515 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™.