/*
 * DCOMM.C
 *
 * Purpose: to defeat call waiting by creating the proper carrier loss/
 *          carrier detect (time) window.
 *
 * Usage: DCOMM <enter>
 *
 * Dan Goldberg, Quick C v2.5, 10/91
 *
 * Compile (tested by LZ under Borland C++):
 *  bcc -D__MSC dcomm.c
 */

#include <stdio.h>
#include <conio.h>
#include <bios.h>

#define __MSC
#define COMPORT 1         /* 0 for COM1, 1 for COM2 */

void set_modem(char *setup_string)
   {
   while(*setup_string != '\0'){
      outp(0x03f8,*setup_string);
      printf("%c", *setup_string);
      *setup_string++;
      }
   }


main()
{
   /* initialize serial port */
   unsigned data;
   /* all constants (except COMPORT) defined in bios.h */
   /* see bios.h for more information on _bios_serialcom */

   data = (_COM_CHR8 | _COM_STOP1 | _COM_NOPARITY |
       _COM_2400);
   _bios_serialcom( _COM_INIT, COMPORT, data);

   /* call setmodem function for call-waiting defeat string */
   set_modem("AT S10=19");
} /* end of program */
